|
|
@@ -19,6 +19,10 @@
|
|
|
<result column="stdNum" property="stdNum"/>
|
|
|
<result column="mouldKindName" property="mouldKindName"/>
|
|
|
<result column="checkUserName" property="checkUserName"/>
|
|
|
+ <result column="mouldModelCodeName" property="mouldModelCodeName"/>
|
|
|
+ <result column="productModelCodeName" property="productModelCodeName"/>
|
|
|
+ <result column="place_name" property="placeName"/>
|
|
|
+ <result column="moldlineItemCode" property="moldlineItemCode"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -48,14 +52,27 @@
|
|
|
tu.user_name as makeUserName,
|
|
|
tm.std_num as stdNum,
|
|
|
sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as "mouldKindName",
|
|
|
- '[' || tml.unique_code || '] ' || tml.moldline_name AS "moldlineCodeName",
|
|
|
- tu2.user_name as checkUserName
|
|
|
+ sys.f_code_name(tml.unique_code, tml.moldline_name) AS moldlineCodeName,
|
|
|
+ tu2.user_name as checkUserName,
|
|
|
+ sys.f_code_name(tmm.model_code, tmm.model_name) AS mouldModelCodeName,
|
|
|
+ (
|
|
|
+ select sys.f_array_string(array_agg(distinct sys.f_code_name(tmp.model_code, tmp.model_name)))
|
|
|
+ from mst.t_mould_output tmo
|
|
|
+ left join mst.t_model_product tmp on tmp.model_id = tmo.pdt_model_id
|
|
|
+ where tmo.mould_id = tm.unique_id
|
|
|
+ ) as productModelCodeName,
|
|
|
+ sys.f_concat_level2(tw.wh_name, twp.place_name) as place_name,
|
|
|
+ tmi.item_code as moldlineItemCode
|
|
|
FROM mst.t_mould_check_item tmci
|
|
|
left join mst.t_mould tm on tm.unique_id = tmci.mould_id
|
|
|
+ LEFT JOIN mst.t_model_mould as tmm ON tm.model_id = tmm.model_id
|
|
|
left join core.t_user tu on tu.user_id = tm.make_user_id
|
|
|
LEFT JOIN sys.t_data_kind tdk on tdk.kind_code = tm.mould_kind and tdk.flg_valid
|
|
|
left join core.t_user tu2 on tu2.user_id = tmci.check_user_id
|
|
|
left join mst.t_moldline tml on tml.unique_id = tmci.moldline_id
|
|
|
+ left join mst.t_warehouse tw on tw.wh_id = tm.wh_id
|
|
|
+ left join mst.t_warehouse_place twp on twp.place_id = tm.place_id
|
|
|
+ left join mst.t_moldline_item tmi on tmi.item_id = tm.moldline_item_id
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -174,7 +191,7 @@
|
|
|
<if test="mouldCode==null or mouldCode==''">
|
|
|
tm.flg_valid and
|
|
|
</if>
|
|
|
- tm.flg_barcode
|
|
|
+ tm.flg_barcode and tm.fty_id = #{ftyId}
|
|
|
<if test="makeItems!=null">
|
|
|
<if test="makeItems.makeDate != null and makeItems.makeDate.size()> 0">
|
|
|
and tm.make_date >= #{makeItems.makeDate[0]}::timestamp with time zone
|
|
|
@@ -189,8 +206,8 @@
|
|
|
<if test="makeItems.mouldKindIds!=null">
|
|
|
and tm.mould_kind = any (#{makeItems.mouldKindIds, typeHandler=StringListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="makeItems.placeId!=null">
|
|
|
- and tm.place_id = any (#{makeItems.placeId, typeHandler=IntListTypeHandler})
|
|
|
+ <if test="makeItems.whId!=null">
|
|
|
+ and tm.wh_id = any (#{makeItems.whId, typeHandler=IntListTypeHandler})
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="mouldCode!=null and mouldCode!=''">
|