|
|
@ -78,6 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="endFlag" column="end_flag" />
|
|
|
|
<result property="endFlag" column="end_flag" />
|
|
|
|
<result property="carNum" column="car_num" />
|
|
|
|
<result property="carNum" column="car_num" />
|
|
|
|
<result property="sortNo" column="sort_no" />
|
|
|
|
<result property="sortNo" column="sort_no" />
|
|
|
|
|
|
|
|
<result property="workorderCodes" column="workorderCodes" />
|
|
|
|
|
|
|
|
<result property="productCodes" column="productCodes" />
|
|
|
|
|
|
|
|
<result property="productNames" column="productNames" />
|
|
|
|
|
|
|
|
<result property="quantitySplits" column="quantitySplits" />
|
|
|
|
|
|
|
|
<result property="units" column="units" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectMesReportWorkVo">
|
|
|
|
<sql id="selectMesReportWorkVo">
|
|
|
|
select id, report_type, report_code, workorder_code, product_code,
|
|
|
|
select id, report_type, report_code, workorder_code, product_code,
|
|
|
@ -213,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="productDateStart != null "> and CONVERT(varchar(10),mrw.feedback_time, 120) >= #{productDateStart}</if>
|
|
|
|
<if test="productDateStart != null "> and CONVERT(varchar(10),mrw.feedback_time, 120) >= #{productDateStart}</if>
|
|
|
|
<if test="productDateEnd != null "> and #{productDateEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120)</if>
|
|
|
|
<if test="productDateEnd != null "> and #{productDateEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120)</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="getReportWorkList" resultType="com.op.mes.domain.MesReportWork">
|
|
|
|
<select id="getReportWork" resultType="com.op.mes.domain.MesReportWork">
|
|
|
|
select
|
|
|
|
select
|
|
|
|
ow.order_code orderCode,
|
|
|
|
ow.order_code orderCode,
|
|
|
|
ow.workorder_code workorderCode,
|
|
|
|
ow.workorder_code workorderCode,
|
|
|
@ -235,8 +242,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
|
|
|
|
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
|
|
|
|
left join pro_route rte on rte.route_code = ow.route_code
|
|
|
|
left join pro_route rte on rte.route_code = ow.route_code
|
|
|
|
where mrw.upload_status != #{uploadStatus} and mrw.prod_type = #{prodType}
|
|
|
|
where mrw.upload_status != #{uploadStatus} and mrw.prod_type = #{prodType}
|
|
|
|
<if test="reportCode != null ">
|
|
|
|
<if test="workorderCode != null ">
|
|
|
|
and mrw.report_code = #{reportCode}
|
|
|
|
and mrw.workorder_code = #{workorderCode}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
order by mrw.create_time
|
|
|
|
order by mrw.create_time
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -421,14 +428,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
pow.product_spc, pow.unit, pow.quantity_split,
|
|
|
|
pow.product_spc, pow.unit, pow.quantity_split,
|
|
|
|
pow.route_code, pow.prod_line_code, pow.product_date,
|
|
|
|
pow.route_code, pow.prod_line_code, pow.product_date,
|
|
|
|
pow.shift_id, pow.parent_order, pow.status, pow.remark,
|
|
|
|
pow.shift_id, pow.parent_order, pow.status, pow.remark,
|
|
|
|
s.Shift_Desc shiftName
|
|
|
|
s.Shift_Desc shiftName,
|
|
|
|
|
|
|
|
pows.workorder_code workorderCodes,pows.product_code productCodes, pows.product_name productNames,
|
|
|
|
|
|
|
|
pows.quantity_split quantitySplits,pows.unit units
|
|
|
|
from pro_order_workorder pow
|
|
|
|
from pro_order_workorder pow
|
|
|
|
left join base_shifts_t s on pow.shift_id = s.Shift_Id
|
|
|
|
left join base_shifts_t s on pow.shift_id = s.Shift_Id
|
|
|
|
|
|
|
|
left join pro_order_workorder pows on pows.parent_order = pow.workorder_code
|
|
|
|
where pow.del_flag = '0' and pow.status = 'w2' and pow.parent_order ='0'
|
|
|
|
where pow.del_flag = '0' and pow.status = 'w2' and pow.parent_order ='0'
|
|
|
|
order by pow.product_date desc
|
|
|
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">
|
|
|
|
<if test="workorderCode != null and workorderCode != ''">
|
|
|
|
and pow.workorder_code like concat('%', #{workorderCode}, '%')
|
|
|
|
and pow.workorder_code like concat('%', #{workorderCode}, '%')
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
|
|
|
|
order by pow.product_date desc
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="getEquipInfoByCodes" resultType="com.op.system.api.domain.device.EquEquipmentDTO">
|
|
|
|
<select id="getEquipInfoByCodes" resultType="com.op.system.api.domain.device.EquEquipmentDTO">
|
|
|
|
select equipment_code equipmentCode,equipment_name equipmentName from base_equipment where equipment_code in
|
|
|
|
select equipment_code equipmentCode,equipment_name equipmentName from base_equipment where equipment_code in
|
|
|
@ -449,9 +460,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
where powb.del_flag = '0' and pow.del_flag = '0'
|
|
|
|
where powb.del_flag = '0' and pow.del_flag = '0'
|
|
|
|
and pow.workorder_code = #{workorderCode}
|
|
|
|
and pow.workorder_code = #{workorderCode}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="getSapWorkOrder" resultType="java.lang.String">
|
|
|
|
<select id="getSapWorkOrder" resultType="com.op.mes.domain.MesReportWork">
|
|
|
|
select workorder_code_sap from pro_order_workorder
|
|
|
|
select workorder_code_sap workorderCodeSap,
|
|
|
|
|
|
|
|
workorder_code workorderCode
|
|
|
|
|
|
|
|
from pro_order_workorder
|
|
|
|
where belong_work_order = #{workorderCode} and del_flag = '0'
|
|
|
|
where belong_work_order = #{workorderCode} and del_flag = '0'
|
|
|
|
|
|
|
|
order by parent_order
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getReportWorkHzList" resultType="com.op.mes.domain.MesReportWork">
|
|
|
|
|
|
|
|
select mrw.workorderCode,mrw.productCode,mrw.productName,mrw.machineCode,mrw.machineName,
|
|
|
|
|
|
|
|
mrw.shiftCode,mrw.feedbackTime feedbackTimeStr,mrw.quantityFeedback,mrw.unit,
|
|
|
|
|
|
|
|
mrw.workTime,mrw.useMan,mrw.uploadTime,mrw.uploadStatus,
|
|
|
|
|
|
|
|
pow.order_code orderCode,pow.quantity_split quantity
|
|
|
|
|
|
|
|
from (
|
|
|
|
|
|
|
|
select workorder_code workorderCode,
|
|
|
|
|
|
|
|
product_code productCode,
|
|
|
|
|
|
|
|
product_name productName,
|
|
|
|
|
|
|
|
machine_code machineCode,
|
|
|
|
|
|
|
|
machine_name machineName,
|
|
|
|
|
|
|
|
shift_code shiftCode,
|
|
|
|
|
|
|
|
CONVERT(varchar(10),feedback_time, 120) feedbackTime,
|
|
|
|
|
|
|
|
sum(quantity_feedback) quantityFeedback,
|
|
|
|
|
|
|
|
sum(work_time) workTime,
|
|
|
|
|
|
|
|
sum(use_man) useMan,
|
|
|
|
|
|
|
|
upload_time uploadTime,
|
|
|
|
|
|
|
|
upload_status uploadStatus,
|
|
|
|
|
|
|
|
unit
|
|
|
|
|
|
|
|
from mes_report_work
|
|
|
|
|
|
|
|
where del_flag = '0' and parent_order = '0'
|
|
|
|
|
|
|
|
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
|
|
|
|
|
|
|
|
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
|
|
|
|
|
|
|
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
|
|
|
|
|
|
|
|
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
|
|
|
|
|
|
|
|
<if test="feedbackTimeStart != null "> and CONVERT(varchar(19),feedback_time, 120) >= #{feedbackTimeStart}</if>
|
|
|
|
|
|
|
|
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= CONVERT(varchar(19),feedback_time, 120)</if>
|
|
|
|
|
|
|
|
<if test="uploadStatus != null and uploadStatus != ''"> and upload_status = #{uploadStatus}</if>
|
|
|
|
|
|
|
|
group by workorder_code, product_code,product_name,CONVERT(varchar(10),feedback_time, 120),machine_code,machine_name,shift_code,
|
|
|
|
|
|
|
|
upload_time,upload_status,unit
|
|
|
|
|
|
|
|
) mrw
|
|
|
|
|
|
|
|
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
order by mrw.feedbackTime desc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getReportList" resultType="com.op.mes.domain.MesReportWork">
|
|
|
|
|
|
|
|
select
|
|
|
|
|
|
|
|
id,
|
|
|
|
|
|
|
|
workorder_code workorderCode,
|
|
|
|
|
|
|
|
report_code reportCode,
|
|
|
|
|
|
|
|
batch,
|
|
|
|
|
|
|
|
quantity_feedback quantityFeedback,
|
|
|
|
|
|
|
|
unit,
|
|
|
|
|
|
|
|
work_time workTime,
|
|
|
|
|
|
|
|
use_man useMan,
|
|
|
|
|
|
|
|
create_time createTime
|
|
|
|
|
|
|
|
from mes_report_work
|
|
|
|
|
|
|
|
where del_flag='0'
|
|
|
|
|
|
|
|
<if test='parentOrder=="0"'>
|
|
|
|
|
|
|
|
and workorder_code = #{workorderCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test='parentOrder!="0"'>
|
|
|
|
|
|
|
|
and parent_order = #{workorderCode}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
order by end_report
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getPrepareList" resultType="com.op.mes.domain.MesPrepareDetail">
|
|
|
|
|
|
|
|
select
|
|
|
|
|
|
|
|
mp.workorder_code workorderCode,
|
|
|
|
|
|
|
|
mpd.material_code materialCode,
|
|
|
|
|
|
|
|
mpd.material_name materialName,
|
|
|
|
|
|
|
|
mpd.quantity,
|
|
|
|
|
|
|
|
mpd.unit,
|
|
|
|
|
|
|
|
mpd.recoil,
|
|
|
|
|
|
|
|
pow.parent_order parentOrder
|
|
|
|
|
|
|
|
from mes_prepare mp
|
|
|
|
|
|
|
|
left join mes_prepare_detail mpd on mpd.prepare_id = mp.prepare_id
|
|
|
|
|
|
|
|
left join pro_order_workorder pow on pow.workorder_code = mp.workorder_code
|
|
|
|
|
|
|
|
where (pow.workorder_code = #{workorderCode} or pow.parent_order = #{workorderCode})
|
|
|
|
|
|
|
|
and mp.del_flag = '0' and mpd.del_flag = '0'
|
|
|
|
|
|
|
|
order by mp.workorder_code
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertMesReportWork" parameterType="MesReportWork">
|
|
|
|
<insert id="insertMesReportWork" parameterType="MesReportWork">
|
|
|
@ -533,6 +622,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="endReport != null and endReport != ''">#{endReport},</if>
|
|
|
|
<if test="endReport != null and endReport != ''">#{endReport},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<insert id="addReportPS">
|
|
|
|
|
|
|
|
insert into mes_report_work
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
id,report_type,report_code,
|
|
|
|
|
|
|
|
workorder_code,parent_order,
|
|
|
|
|
|
|
|
product_code,product_name,
|
|
|
|
|
|
|
|
unit,quantity,quantity_feedback,
|
|
|
|
|
|
|
|
user_name,nick_name,feedback_channel,
|
|
|
|
|
|
|
|
feedback_time,remark,
|
|
|
|
|
|
|
|
work_time,use_man,batch,
|
|
|
|
|
|
|
|
machine_code,machine_name,shift_code,work_center,
|
|
|
|
|
|
|
|
create_by,create_time,del_flag,end_report
|
|
|
|
|
|
|
|
)values
|
|
|
|
|
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
|
|
|
|
|
(
|
|
|
|
|
|
|
|
#{item.id},'UNI',#{item.reportCode},
|
|
|
|
|
|
|
|
#{item.workorderCode},#{item.parentOrder},
|
|
|
|
|
|
|
|
#{item.productCode},#{item.productName},
|
|
|
|
|
|
|
|
#{item.unit},#{item.quantity},#{item.quantityFeedback},
|
|
|
|
|
|
|
|
#{item.userName},#{item.nickName},#{item.feedbackChannel},
|
|
|
|
|
|
|
|
#{item.feedbackTime},#{item.remark},
|
|
|
|
|
|
|
|
#{item.workTime},#{item.useMan},#{item.batch},
|
|
|
|
|
|
|
|
#{item.machineCode},#{item.machineName},#{item.shiftId},#{item.workCenter},
|
|
|
|
|
|
|
|
#{item.createBy},#{item.createTime},'0',#{item.endReport}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateMesReportWork" parameterType="MesReportWork">
|
|
|
|
<update id="updateMesReportWork" parameterType="MesReportWork">
|
|
|
|
update mes_report_work
|
|
|
|
update mes_report_work
|
|
|
@ -582,15 +698,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="uploadMsg != null">upload_msg = #{uploadMsg},</if>
|
|
|
|
<if test="uploadMsg != null">upload_msg = #{uploadMsg},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
where 1=1
|
|
|
|
where 1=1
|
|
|
|
<if test="id != null">
|
|
|
|
<if test="id != null">and id = #{id}</if>
|
|
|
|
and id = #{id}
|
|
|
|
<if test="workorderCode != null">and workorder_code = #{workorderCode}</if>
|
|
|
|
</if>
|
|
|
|
</update>
|
|
|
|
<if test="reportCode != null">
|
|
|
|
<update id="updateOrderWorkStatus">
|
|
|
|
and report_code = #{reportCode}
|
|
|
|
update pro_order_workorder
|
|
|
|
</if>
|
|
|
|
set status = #{status},
|
|
|
|
|
|
|
|
update_by = #{updateBy},
|
|
|
|
|
|
|
|
update_time = #{updateTime}
|
|
|
|
|
|
|
|
where belong_work_order = #{workorderCode}
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
<update id="updateWorkOrderStatus">
|
|
|
|
|
|
|
|
update pro_order_workorder set status = #{status} where workorder_code = #{workorderCode}
|
|
|
|
<update id="submitReportPS">
|
|
|
|
|
|
|
|
<foreach collection="list" item="item" separator=";">
|
|
|
|
|
|
|
|
update mes_report_work
|
|
|
|
|
|
|
|
set quantity_feedback = #{item.quantityFeedback},
|
|
|
|
|
|
|
|
work_time = #{item.workTime},
|
|
|
|
|
|
|
|
use_man = #{item.useMan},
|
|
|
|
|
|
|
|
update_by = #{item.updateBy},
|
|
|
|
|
|
|
|
update_time = #{item.updateTime}
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
id = #{item.id}
|
|
|
|
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteMesReportWorkById" parameterType="String">
|
|
|
|
<delete id="deleteMesReportWorkById" parameterType="String">
|
|
|
|