|
|
@@ -20,13 +20,15 @@
|
|
|
</select>
|
|
|
|
|
|
<!--获取编码-->
|
|
|
- <select id="getUniqueCode" resultType="java.util.Map">
|
|
|
- select out_id AS "outId",out_code AS "outNote" from dkic_b.f_create_code_id(#{cpId},#{docName});
|
|
|
+ <select id="getUniqueCode" resultType="java.util.Map">
|
|
|
+ select out_id AS "outId", out_code AS "outNote"
|
|
|
+ from dkic_b.f_create_code_id(#{cpId}, #{docName});
|
|
|
</select>
|
|
|
|
|
|
<!--获取单号-->
|
|
|
- <select id="getUniqueNote" resultType="java.util.Map">
|
|
|
- select out_id AS "outId",out_note AS "outNote" from dkic_b.f_create_note_id(#{cpId},#{docName});
|
|
|
+ <select id="getUniqueNote" resultType="java.util.Map">
|
|
|
+ select out_id AS "outId", out_note AS "outNote"
|
|
|
+ from dkic_b.f_create_note_id(#{cpId}, #{docName});
|
|
|
</select>
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="java.util.Map">
|
|
|
@@ -628,7 +630,7 @@
|
|
|
select sku_id as "skuId",
|
|
|
sku_code as "skuCode",
|
|
|
sku_name as "skuName",
|
|
|
- remarks as "remarks"
|
|
|
+ remarks as "remarks"
|
|
|
from mst.t_erp_sku
|
|
|
where flg_valid
|
|
|
and fty_id = #{ftyId}
|
|
|
@@ -681,16 +683,16 @@
|
|
|
|
|
|
<!-- 获取数据字典 -->
|
|
|
<select id="getDictionaryData" resultType="java.util.Map">
|
|
|
- select tdd.data_id AS "dataId",
|
|
|
- tdd.data_value as "dataValue",
|
|
|
- tdd.dict_code AS "dictCode"
|
|
|
- from core.t_dictionary_data as tdd
|
|
|
- where tdd.flg_valid
|
|
|
- and (tdd.fty_id = #{ftyId} OR tdd.fty_id = 0)
|
|
|
- <if test="dictCode != null and dictCode != ''">
|
|
|
- and tdd.dict_code = #{dictCode}
|
|
|
- </if>
|
|
|
- order by tdd.display_no
|
|
|
+ select dd.data_id as "dataId",
|
|
|
+ dd.dict_code as "dictCode",
|
|
|
+ dd.data_code as "dataCode",
|
|
|
+ dd.data_value as "dataValue",
|
|
|
+ dd.flg_default as "flgDefault"
|
|
|
+ from dkic_b.t_mst_dictionary_data as dd
|
|
|
+ where dd.flg_valid
|
|
|
+ and dd.cp_id = #{cpId}
|
|
|
+ and dd.dict_code = #{dictCode}
|
|
|
+ order by dd.display_no
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取数据类型 -->
|
|
|
@@ -1208,17 +1210,18 @@
|
|
|
|
|
|
<!-- 查询损坯原因/产品缺陷/开模损原因-->
|
|
|
<select id="getProductDefect" resultMap="getProductDefectMap">
|
|
|
- select tpd.defect_id AS "defectId",
|
|
|
- tpd.defect_name AS "defectName",
|
|
|
- tpd.defect_code AS "defectCode",
|
|
|
- sys.f_code_name(tpd.defect_code,tpd.defect_name) AS "codeName",
|
|
|
- tpd.defect_types as "defectTypes",
|
|
|
+ select tpd.defect_id AS "defectId",
|
|
|
+ tpd.defect_name AS "defectName",
|
|
|
+ tpd.defect_code AS "defectCode",
|
|
|
+ sys.f_code_name(tpd.defect_code, tpd.defect_name) AS "codeName",
|
|
|
+ tpd.defect_types as "defectTypes",
|
|
|
(
|
|
|
select json_agg(jsonb_build_object('fineId', fine_id, 'fineName', fine_name,
|
|
|
- 'deductNum', deduct_num,'fineCodeName',sys.f_code_name(fine_code,fine_name)))
|
|
|
+ 'deductNum', deduct_num, 'fineCodeName',
|
|
|
+ sys.f_code_name(fine_code, fine_name)))
|
|
|
from mst.t_product_defect_fine
|
|
|
- where fine_id = any(tpd.defect_fines)
|
|
|
- ) as "defectFines"
|
|
|
+ where fine_id = any (tpd.defect_fines)
|
|
|
+ ) as "defectFines"
|
|
|
from mst.t_product_defect tpd
|
|
|
where tpd.fty_id = #{ftyId}
|
|
|
and tpd.flg_valid
|
|
|
@@ -2119,7 +2122,7 @@
|
|
|
select appm.menu_uuid AS "menuUuid"
|
|
|
, appm.menu_name as name
|
|
|
, sys.f_get_name_i18n_lang(appm.menu_name_i18n, #{i18n}) as "menuName"
|
|
|
- , appm.fun_uuid AS "funUuid"
|
|
|
+ , appm.fun_uuid AS "funUuid"
|
|
|
, appm.object_code AS "objectCode"
|
|
|
, appm.menu_type AS "menuType"
|
|
|
from sys.t_app_menu appm
|
|
|
@@ -2200,13 +2203,15 @@
|
|
|
SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n, #{i18n}) as "kindName"
|
|
|
FROM sys.t_data_kind t
|
|
|
where t.kind_type = '型号种类'
|
|
|
- and t.kind_tags -> 'used' ?? '标签' and flg_valid
|
|
|
+ and t.kind_tags - > 'used' ?? '标签' and flg_valid
|
|
|
order by t.display_no
|
|
|
</select>
|
|
|
|
|
|
<select id="getModelProductLabelType" resultType="java.util.Map">
|
|
|
- SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n,#{i18n}) as "kindName"
|
|
|
- from sys.t_data_kind t where t.kind_type='验证标签' and (t.kind_tags->>'source')='产品型号'
|
|
|
+ SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n, #{i18n}) as "kindName"
|
|
|
+ from sys.t_data_kind t
|
|
|
+ where t.kind_type = '验证标签'
|
|
|
+ and (t.kind_tags ->>'source') = '产品型号'
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取窑炉类型 -->
|
|
|
@@ -2406,14 +2411,13 @@
|
|
|
|
|
|
<!-- 获取计量单位 -->
|
|
|
<select id="getModelUnits" resultType="java.util.Map">
|
|
|
- select
|
|
|
- tmu.unit_id AS "unitId",
|
|
|
- tmu.unit_code as "unitCode",
|
|
|
- tmu.unit_name as "unitName",
|
|
|
- tmu.unit_scale as "unitScale"
|
|
|
+ select tmu.unit_id AS "unitId",
|
|
|
+ tmu.unit_code as "unitCode",
|
|
|
+ tmu.unit_name as "unitName",
|
|
|
+ tmu.unit_scale as "unitScale"
|
|
|
from mst.t_model_units as tmu
|
|
|
where tmu.flg_valid
|
|
|
- and tmu.fty_id = #{ftyId}
|
|
|
+ and tmu.fty_id = #{ftyId}
|
|
|
order by tmu.display_no
|
|
|
</select>
|
|
|
|
|
|
@@ -2455,15 +2459,15 @@
|
|
|
|
|
|
<!-- 获取报工项目-->
|
|
|
<select id="getWorkProject" resultType="java.util.Map">
|
|
|
- select p.project_id as "projectIid",
|
|
|
- p.project_code as "projectCode",
|
|
|
- p.project_name as "projectName",
|
|
|
- p.project_kind as "projectKind",
|
|
|
- sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as "projectkindName",
|
|
|
- p.item_kind as "itemKind",
|
|
|
- p.station_id as "stationId",
|
|
|
- p.pdt_grades as "pdtGrades",
|
|
|
- p.pdt_defects as "pdtDefects",
|
|
|
+ select p.project_id as "projectIid",
|
|
|
+ p.project_code as "projectCode",
|
|
|
+ p.project_name as "projectName",
|
|
|
+ p.project_kind as "projectKind",
|
|
|
+ sys.f_get_name_i18n_lang(tdk.kind_name_i18n, #{i18n}) as "projectkindName",
|
|
|
+ p.item_kind as "itemKind",
|
|
|
+ p.station_id as "stationId",
|
|
|
+ p.pdt_grades as "pdtGrades",
|
|
|
+ p.pdt_defects as "pdtDefects",
|
|
|
p.remarks
|
|
|
from mst.t_work_project p
|
|
|
left join sys.t_data_kind as tdk
|
|
|
@@ -2538,15 +2542,14 @@
|
|
|
select count(1)
|
|
|
from mst.t_product_defect tpd
|
|
|
where tpd.fty_id = #{ftyId}
|
|
|
- and tpd.flg_valid
|
|
|
+ and tpd.flg_valid
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<!-- 获取应用-->
|
|
|
<select id="getApplication" resultType="java.util.Map">
|
|
|
- select
|
|
|
- app_code as "appCode",
|
|
|
- app_name as "appName"
|
|
|
+ select app_code as "appCode",
|
|
|
+ app_name as "appName"
|
|
|
from sys.t_application
|
|
|
</select>
|
|
|
|
|
|
@@ -2562,17 +2565,16 @@
|
|
|
|
|
|
<!--获取工位打印机-->
|
|
|
<select id="getWsPrinter" resultType="java.util.Map">
|
|
|
- select
|
|
|
- ptwp.wsp_id as "wspId",
|
|
|
- ptwp.printer_id as "printerId",
|
|
|
- mtlp.printer_code as "printerCode",
|
|
|
- mtlp.printer_name as "printerName",
|
|
|
- sys.f_code_name(mtlp.printer_code,mtlp.printer_name) AS "printerCodeName"
|
|
|
+ select ptwp.wsp_id as "wspId",
|
|
|
+ ptwp.printer_id as "printerId",
|
|
|
+ mtlp.printer_code as "printerCode",
|
|
|
+ mtlp.printer_name as "printerName",
|
|
|
+ sys.f_code_name(mtlp.printer_code, mtlp.printer_name) AS "printerCodeName"
|
|
|
from pdm.t_ws_printer ptwp
|
|
|
- left join mst.t_label_printer mtlp on mtlp.printer_id = ptwp.printer_id
|
|
|
+ left join mst.t_label_printer mtlp on mtlp.printer_id = ptwp.printer_id
|
|
|
where ptwp.fty_id = #{ftyId}
|
|
|
and ptwp.station_id = #{stationId}
|
|
|
- and ptwp.flg_valid
|
|
|
+ and ptwp.flg_valid
|
|
|
</select>
|
|
|
|
|
|
<!--获取仓库-->
|
|
|
@@ -2655,16 +2657,16 @@
|
|
|
|
|
|
<!--获取下拉选-->
|
|
|
<select id="getSelectType" resultType="java.util.Map">
|
|
|
- SELECT select_id as "selectId",
|
|
|
- select_name as "selectName"
|
|
|
+ SELECT select_id as "selectId",
|
|
|
+ select_name as "selectName"
|
|
|
FROM mst.t_custom_select_type
|
|
|
WHERE fty_id = #{ftyId}
|
|
|
- and flg_valid
|
|
|
+ and flg_valid
|
|
|
</select>
|
|
|
|
|
|
<!--获取下拉选-->
|
|
|
<select id="getSelectMagnifier" resultType="java.util.Map">
|
|
|
- SELECT magnifier_id as "magnifierId",
|
|
|
+ SELECT magnifier_id as "magnifierId",
|
|
|
magnifier_name as "magnifierName"
|
|
|
FROM mst.t_custom_select_magnifier
|
|
|
WHERE fty_id = #{ftyId}
|
|
|
@@ -2901,13 +2903,15 @@
|
|
|
tms.sup_name as "supplierName",
|
|
|
tms.sup_id as "supplierId",
|
|
|
tms.sup_type as "supplierType",
|
|
|
+ tms.contact_name as "contactName",
|
|
|
+ tms.contact_phone as "contactPhone",
|
|
|
tms.flg_valid as "flgValid"
|
|
|
from dkic_b.t_mst_supplier tms
|
|
|
where tms.cp_id = #{cpId}
|
|
|
- <if test="supplierName!=null and supplierName!=''" >
|
|
|
+ <if test="supplierName!=null and supplierName!=''">
|
|
|
AND tms.sup_name LIKE concat('%', #{supplierName}, '%')
|
|
|
</if>
|
|
|
- <if test="supplierCode!=null and supplierCode!=''" >
|
|
|
+ <if test="supplierCode!=null and supplierCode!=''">
|
|
|
AND tms.sup_code LIKE concat('%', #{supplierCode}, '%')
|
|
|
</if>
|
|
|
order by tms.sup_code
|
|
|
@@ -2924,11 +2928,36 @@
|
|
|
select count(1)
|
|
|
from dkic_b.t_mst_supplier tms
|
|
|
where tms.cp_id = #{cpId}
|
|
|
- <if test="supplierName!=null and supplierName!=''" >
|
|
|
+ <if test="supplierName!=null and supplierName!=''">
|
|
|
AND tms.sup_name LIKE concat('%', #{supplierName}, '%')
|
|
|
</if>
|
|
|
- <if test="supplierCode!=null and supplierCode!=''" >
|
|
|
+ <if test="supplierCode!=null and supplierCode!=''">
|
|
|
AND tms.sup_code LIKE concat('%', #{supplierCode}, '%')
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <!--获取渠道 -->
|
|
|
+ <select id="getChannel" resultType="java.util.Map">
|
|
|
+ select c.channel_id as "channelId",
|
|
|
+ c.channel_code as "channelCode",
|
|
|
+ c.channel_name as "channelName",
|
|
|
+ c.sys_code as "sysCode",
|
|
|
+ c.display_no as "displayNo"
|
|
|
+ from dkic_b.t_mst_sale_channel as c
|
|
|
+ where c.flg_valid
|
|
|
+ and c.cp_id = #{cpId}
|
|
|
+ <if test="channel_code!=null and channel_code!=''">
|
|
|
+ AND c.channel_code LIKE concat('%', #{channelCode}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="channel_name!=null and channel_name!=''">
|
|
|
+ AND c.channel_name LIKE concat('%', #{channelName}, '%')
|
|
|
+ </if>
|
|
|
+ order by c.display_no
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ <if test="limit != null and limit != 0 ">
|
|
|
+ limit #{limit}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|