|
|
@@ -22,6 +22,18 @@
|
|
|
sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as mould_kind_name
|
|
|
</sql>
|
|
|
|
|
|
+ <!-- 磨具跟踪查询列 -->
|
|
|
+ <sql id="Base_Column_List_Mould_Trace">
|
|
|
+ tm.unique_id, tm.unique_code, tm.model_kind, tmo.mould_model_id model_id, tm.remarks, tm.flg_valid, tm.fty_id,
|
|
|
+ tm.flg_auto_uuid, tm.std_num, tm.output_qty, tm.output_std_sum, tm.make_date, tm.make_user_id,
|
|
|
+ tm.material_type, tmo.mould_kind, tm.moldline_id, tm.moldline_group_id, tm.moldline_item_id,
|
|
|
+ tmo.scrap_date, tmo.scrap_user_id ,tmo.opn_time,
|
|
|
+ tmm.model_name, tmm.model_code,tmmi.unused_num,tml.unique_code moldline_code,tu.user_name opn_user_name,
|
|
|
+ tuc.user_name scrap_user_name,
|
|
|
+ sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as mould_kind_name,
|
|
|
+ sys.f_get_name_i18n_lang(tdkp.kind_name_i18n,#{i18n}) as per_mould_kind_name
|
|
|
+ </sql>
|
|
|
+
|
|
|
<sql id="Base_Column_List_Join">
|
|
|
tm.unique_id, tm.unique_code, tm.model_kind, tm.model_id, tm.remarks, tm.flg_valid, tm.fty_id,
|
|
|
tm.flg_auto_uuid, tm.std_num, tm.output_qty,
|
|
|
@@ -113,6 +125,7 @@
|
|
|
typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
|
|
|
<result column="material_type" property="materialType"/>
|
|
|
<result column="mould_kind" property="mouldKind"/>
|
|
|
+ <result column="per_mould_kind" property="perMouldKind"/>
|
|
|
<result column="moldline_group_id" property="moldlineGroupId"/>
|
|
|
<result column="scrap_date" property="scrapDate"
|
|
|
typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
|
|
|
@@ -123,11 +136,15 @@
|
|
|
<result column="model_name" property="modelName" />
|
|
|
<result column="model_code" property="modelCode" />
|
|
|
<result column="mould_kind_name" property="mouldKindName"/>
|
|
|
+ <result column="per_mould_kind_name" property="perMouldKindName"/>
|
|
|
<result column="moldline_id" property="moldlineId"/>
|
|
|
<result column="moldline_code" property="moldlineCode"/>
|
|
|
<result column="unused_num" property="unusedNum"/>
|
|
|
<result column="make_user_name" property="makeUserName"/>
|
|
|
+ <result column="opn_user_name" property="opnUserName"/>
|
|
|
<result column="scrap_user_name" property="makeUserName"/>
|
|
|
+ <result column="opn_time" property="opnTime"
|
|
|
+ typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
@@ -327,6 +344,24 @@
|
|
|
and tm.flg_barcode
|
|
|
and tm.flg_valid
|
|
|
</select>
|
|
|
+<!--磨具跟踪-->
|
|
|
+ <select id="selectMouldTraceByCode" resultMap="BaseResultMap_Join_Mould">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Mould_Trace"/>
|
|
|
+ FROM mst.t_mould_opn tmo
|
|
|
+ inner JOIN mst.t_mould tm on tmo.mould_id = tm.unique_id
|
|
|
+ LEFT JOIN mst.t_model_mould tmm on tmm.model_id = tmo.mould_model_id
|
|
|
+ LEFT JOIN mst.t_moldline tml on tmo.moldline_id = tml.unique_id
|
|
|
+ LEFT JOIN mst.t_mould_molded tmmi on tm.unique_id = tmmi.mould_id
|
|
|
+ LEFT JOIN core.t_user tu ON tu.user_id = tmo.opn_user_id
|
|
|
+ LEFT JOIN core.t_user tuc ON tuc.user_id = tmo.scrap_user_id
|
|
|
+ LEFT join sys.t_data_kind tdk on tdk.kind_code = tmo.mould_kind
|
|
|
+ LEFT join sys.t_data_kind tdkp on tdkp.kind_code = tmo.per_mould_kind
|
|
|
+ where tm.unique_code = #{uniqueCode}
|
|
|
+ AND tmo.fty_id = #{ftyId}
|
|
|
+ and tm.flg_barcode
|
|
|
+ order by tmo.opn_time DESC
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
insert into t_mould
|