|
|
@ -91,6 +91,51 @@
|
|
|
|
where obj_id = #{objId}
|
|
|
|
where obj_id = #{objId}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectAggProdPlanExecuteUserList" parameterType="ProdPlanExecuteUser" resultMap="ProdPlanExecuteUserResult">
|
|
|
|
|
|
|
|
SELECT ppeu.order_code,
|
|
|
|
|
|
|
|
ppeu.plan_code,
|
|
|
|
|
|
|
|
ppeu.process_code,
|
|
|
|
|
|
|
|
ppeu.station_code,
|
|
|
|
|
|
|
|
bpl.product_line_name AS station_name,
|
|
|
|
|
|
|
|
ppeu.complete_amount,
|
|
|
|
|
|
|
|
ppeu.plan_begin_date,
|
|
|
|
|
|
|
|
ppeu.plan_end_date,
|
|
|
|
|
|
|
|
ppeu.batch_number,
|
|
|
|
|
|
|
|
STUFF(
|
|
|
|
|
|
|
|
(SELECT DISTINCT ', ' + CAST(ppeu_inner.staff_id AS VARCHAR)
|
|
|
|
|
|
|
|
FROM prod_plan_execute_user ppeu_inner
|
|
|
|
|
|
|
|
WHERE ppeu_inner.plan_code = ppeu.plan_code
|
|
|
|
|
|
|
|
AND ppeu_inner.batch_number = ppeu.batch_number
|
|
|
|
|
|
|
|
FOR XML PATH('')), 1, 2, '') AS staff_id,
|
|
|
|
|
|
|
|
STUFF(
|
|
|
|
|
|
|
|
(SELECT DISTINCT ', ' + bsi.staff_name
|
|
|
|
|
|
|
|
FROM base_staff_info bsi
|
|
|
|
|
|
|
|
LEFT JOIN prod_plan_execute_user ppeu_inner ON ppeu_inner.staff_id = bsi.staff_id
|
|
|
|
|
|
|
|
WHERE ppeu_inner.plan_code = ppeu.plan_code
|
|
|
|
|
|
|
|
AND ppeu_inner.batch_number = ppeu.batch_number
|
|
|
|
|
|
|
|
FOR XML PATH('')), 1, 2, '') AS staff_name
|
|
|
|
|
|
|
|
FROM prod_plan_execute_user ppeu
|
|
|
|
|
|
|
|
LEFT JOIN base_product_line bpl ON bpl.product_line_code = ppeu.station_code
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="orderCode != null and orderCode != ''">and ppeu.order_code = #{orderCode}</if>
|
|
|
|
|
|
|
|
<if test="planCode != null and planCode != ''">and ppeu.plan_code = #{planCode}</if>
|
|
|
|
|
|
|
|
<if test="processCode != null and processCode != ''">and ppeu.process_code = #{processCode}</if>
|
|
|
|
|
|
|
|
<if test="stationCode != null and stationCode != ''">and ppeu.station_code = #{stationCode}</if>
|
|
|
|
|
|
|
|
<if test="staffId != null and staffId != ''">and ppeu.staff_id = #{staffId}</if>
|
|
|
|
|
|
|
|
<if test="completeAmount != null ">and ppeu.complete_amount = #{completeAmount}</if>
|
|
|
|
|
|
|
|
<if test="planBeginDate != null ">and ppeu.plan_begin_date = #{planBeginDate}</if>
|
|
|
|
|
|
|
|
<if test="planEndDate != null ">and ppeu.plan_end_date = #{planEndDate}</if>
|
|
|
|
|
|
|
|
<if test="isFlag != null and isFlag != ''">and ppeu.is_flag = #{isFlag}</if>
|
|
|
|
|
|
|
|
<if test="batchNumber != null and batchNumber != ''">and ppeu.batch_number = #{batchNumber}</if>
|
|
|
|
|
|
|
|
<if test="params.beginOrderDate != null and params.beginOrderDate != '' and params.endOrderDate != null and params.endOrderDate != ''">
|
|
|
|
|
|
|
|
and FORMAT(ppeu.plan_end_date, 'yyyy-MM-dd') between #{params.beginOrderDate} and #{params.endOrderDate}
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
GROUP BY ppeu.order_code, ppeu.plan_code, ppeu.process_code, ppeu.station_code, bpl.product_line_name,
|
|
|
|
|
|
|
|
ppeu.complete_amount, ppeu.plan_begin_date, ppeu.plan_end_date, ppeu.batch_number
|
|
|
|
|
|
|
|
ORDER BY ppeu.order_code desc, ppeu.station_code, ppeu.batch_number
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertProdPlanExecuteUser" parameterType="ProdPlanExecuteUser" useGeneratedKeys="true"
|
|
|
|
<insert id="insertProdPlanExecuteUser" parameterType="ProdPlanExecuteUser" useGeneratedKeys="true"
|
|
|
|
keyProperty="objId">
|
|
|
|
keyProperty="objId">
|
|
|
|
insert into prod_plan_execute_user
|
|
|
|
insert into prod_plan_execute_user
|
|
|
|