change - 工单执行用户聚合用户

main
yinq 3 weeks ago
parent cd2cde0f16
commit 9ae429f52f

@ -58,4 +58,12 @@ public interface ProdPlanExecuteUserMapper {
* @return
*/
public int deleteProdPlanExecuteUserByObjIds(Long[] objIds);
/**
*
*
* @param prodPlanExecuteUser
* @return
*/
List<ProdPlanExecuteUser> selectAggProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser);
}

@ -38,7 +38,7 @@ public class ProdPlanExecuteUserServiceImpl implements IProdPlanExecuteUserServi
*/
@Override
public List<ProdPlanExecuteUser> selectProdPlanExecuteUserList(ProdPlanExecuteUser prodPlanExecuteUser) {
return prodPlanExecuteUserMapper.selectProdPlanExecuteUserList(prodPlanExecuteUser);
return prodPlanExecuteUserMapper.selectAggProdPlanExecuteUserList(prodPlanExecuteUser);
}
/**

@ -186,6 +186,7 @@
<if test="EdgeBandingTotalArea != null ">and EdgeBandingTotalArea = #{EdgeBandingTotalArea}</if>
<if test="WireropeBeltTotalArea != null ">and WireropeBeltTotalArea = #{WireropeBeltTotalArea}</if>
</where>
order by SeqNo desc
</select>
<select id="selectProdOrderDetailByObjId" parameterType="Long" resultMap="ProdOrderDetailResult">

@ -249,6 +249,7 @@
and pod.OrderDate between #{params.beginOrderDate} and #{params.endOrderDate}
</if>
</where>
order by poi.order_code desc
</select>
<select id="selectProdOrderInfoByObjId" parameterType="Long" resultMap="ProdOrderInfoResult">

@ -91,6 +91,51 @@
where obj_id = #{objId}
</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"
keyProperty="objId">
insert into prod_plan_execute_user

Loading…
Cancel
Save