|
|
@ -32,10 +32,10 @@
|
|
|
|
<result property="timeArray" column="timeArray"/>
|
|
|
|
<result property="timeArray" column="timeArray"/>
|
|
|
|
<result property="equipmentCode" column="equipment_code"/>
|
|
|
|
<result property="equipmentCode" column="equipment_code"/>
|
|
|
|
<result property="equipmentName" column="equipment_name"/>
|
|
|
|
<result property="equipmentName" column="equipment_name"/>
|
|
|
|
|
|
|
|
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
<result property="lineName" column="line_name"/>
|
|
|
|
<result property="lineName" column="line_name"/>
|
|
|
|
<result property="workorderId" column="workorder_id"/>
|
|
|
|
<result property="workorderId" column="workorder_id"/>
|
|
|
|
|
|
|
|
<result property="shiftId" column="shiftId"/>
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSelfMutualInspectionList" resultMap="MesInspectionReportResult" parameterType="MesInspectionReport">
|
|
|
|
<select id="selectSelfMutualInspectionList" resultMap="MesInspectionReportResult" parameterType="MesInspectionReport">
|
|
|
@ -92,8 +92,16 @@
|
|
|
|
and mtsd.del_flag = '0'
|
|
|
|
and mtsd.del_flag = '0'
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and mts.report_name = #{reportName}
|
|
|
|
<choose>
|
|
|
|
and mtsd.table_line is not null
|
|
|
|
<when test="shiftId != null">
|
|
|
|
|
|
|
|
AND mts.report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<otherwise>
|
|
|
|
|
|
|
|
AND mts.report_name = #{reportName}
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line
|
|
|
|
group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line
|
|
|
|
order by mtsd.check_time_s
|
|
|
|
order by mtsd.check_time_s
|
|
|
@ -109,7 +117,14 @@
|
|
|
|
and mtsd.del_flag = '0'
|
|
|
|
and mtsd.del_flag = '0'
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and mts.report_name = #{reportName}
|
|
|
|
<choose>
|
|
|
|
|
|
|
|
<when test="shiftId != null">
|
|
|
|
|
|
|
|
AND mts.report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<otherwise>
|
|
|
|
|
|
|
|
AND mts.report_name = #{reportName}
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
group by mtsd.remark
|
|
|
|
group by mtsd.remark
|
|
|
|
order by mtsd.remark
|
|
|
|
order by mtsd.remark
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -127,14 +142,23 @@
|
|
|
|
mts.create_by
|
|
|
|
mts.create_by
|
|
|
|
from mes_table_self mts
|
|
|
|
from mes_table_self mts
|
|
|
|
where 1=1
|
|
|
|
where 1=1
|
|
|
|
<if test="reportName == 'CheckReport'">
|
|
|
|
<choose>
|
|
|
|
and report_name = #{reportName}
|
|
|
|
<when test="shiftId != null and reportName = 'CheckReport'">
|
|
|
|
|
|
|
|
and report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
|
|
|
|
and line_code = #{lineCode}
|
|
|
|
and line_code = #{lineCode}
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
</if>
|
|
|
|
</when>
|
|
|
|
<if test="reportName != 'CheckReport'">
|
|
|
|
<when test="shiftId = null and reportName = 'CheckReport'">
|
|
|
|
|
|
|
|
AND mts.report_name = #{reportName}
|
|
|
|
|
|
|
|
and line_code = #{lineCode}
|
|
|
|
|
|
|
|
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<otherwise>
|
|
|
|
and id = #{id}
|
|
|
|
and id = #{id}
|
|
|
|
</if>
|
|
|
|
</otherwise>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and del_flag = '0'
|
|
|
|
and del_flag = '0'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
@ -149,23 +173,31 @@
|
|
|
|
select
|
|
|
|
select
|
|
|
|
mts.id,
|
|
|
|
mts.id,
|
|
|
|
pow.workorder_id,
|
|
|
|
pow.workorder_id,
|
|
|
|
mts.product_name,
|
|
|
|
pow.product_name,
|
|
|
|
mts.product_code
|
|
|
|
pow.product_code
|
|
|
|
from mes_table_self mts
|
|
|
|
from mes_table_self mts
|
|
|
|
left join pro_order_workorder pow on mts.product_code = pow.product_code
|
|
|
|
left join pro_order_workorder pow on mts.line_code = pow.workorder_name
|
|
|
|
|
|
|
|
LEFT JOIN base_shifts_t bst ON pow.shift_id = bst.Shift_Id
|
|
|
|
where DATEDIFF(DAY, mts.check_date, #{checkDate}) = 0
|
|
|
|
where DATEDIFF(DAY, mts.check_date, #{checkDate}) = 0
|
|
|
|
and DATEDIFF(DAY, pow.product_date, #{checkDate}) = 0
|
|
|
|
and DATEDIFF(DAY, pow.product_date, #{checkDate}) = 0
|
|
|
|
and mts.del_flag = '0'
|
|
|
|
and mts.del_flag = '0'
|
|
|
|
and mts.product_code is not null AND mts.product_code!= ''
|
|
|
|
|
|
|
|
and pow.del_flag = '0'
|
|
|
|
and pow.del_flag = '0'
|
|
|
|
and mts.report_name = #{reportName}
|
|
|
|
and pow.parent_order = '0'
|
|
|
|
|
|
|
|
<choose>
|
|
|
|
|
|
|
|
<when test="shiftId != null">
|
|
|
|
|
|
|
|
AND mts.report_name = CONCAT(#{reportName}, bst.Shift_Desc)
|
|
|
|
|
|
|
|
</when>
|
|
|
|
|
|
|
|
<otherwise>
|
|
|
|
|
|
|
|
AND mts.report_name = #{reportName}
|
|
|
|
|
|
|
|
</otherwise>
|
|
|
|
|
|
|
|
</choose>
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and mts.line_code = #{lineCode}
|
|
|
|
and pow.workorder_name = #{lineCode}
|
|
|
|
and pow.workorder_name = #{lineCode}
|
|
|
|
group by
|
|
|
|
group by
|
|
|
|
mts.id,
|
|
|
|
mts.id,
|
|
|
|
pow.workorder_id,
|
|
|
|
pow.workorder_id,
|
|
|
|
mts.product_name,
|
|
|
|
pow.product_name,
|
|
|
|
mts.product_code
|
|
|
|
pow.product_code
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getDataCodeList" resultType ="com.op.mes.domain.ProOrderWorkorder" parameterType="MesInspectionReport">
|
|
|
|
<select id="getDataCodeList" resultType ="com.op.mes.domain.ProOrderWorkorder" parameterType="MesInspectionReport">
|
|
|
|