This commit is contained in:
parent
e86f1aa88d
commit
aaed24ffcb
|
|
@ -249,4 +249,11 @@ public interface LossAssessmentMapper {
|
|||
* @return
|
||||
*/
|
||||
int delCost(RepairApplyDetails repairApplyDetails);
|
||||
|
||||
/**
|
||||
* 查询repair_task_details
|
||||
* @param repairTaskDetails
|
||||
* @return
|
||||
*/
|
||||
RepairTaskDetails selectRepairTaskDetailsById(RepairTaskDetails repairTaskDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -559,7 +559,11 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
|
|||
//3、重新生成维修数据
|
||||
for (RepairTaskDetails repairTaskDetails : detailsList){
|
||||
repairTaskDetails.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
mapper.insertRad(repairTaskDetails);
|
||||
//查询数据是否已经插入
|
||||
RepairTaskDetails repairTaskDetails1 = mapper.selectRepairTaskDetailsById(repairTaskDetails);
|
||||
if (repairTaskDetails1==null){
|
||||
mapper.insertRad(repairTaskDetails);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("提交完成");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -537,6 +537,22 @@
|
|||
WHERE
|
||||
id = #{id}
|
||||
</select>
|
||||
<select id="selectRepairTaskDetailsById" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||
SELECT
|
||||
id,
|
||||
task_id as taskId
|
||||
FROM
|
||||
repair_apply_details
|
||||
WHERE
|
||||
task_id=#{taskId}
|
||||
and type_id=#{typeId}
|
||||
and repair_num = #{repairNum}
|
||||
<if test="maId != null">
|
||||
and ma_id=#{maId}
|
||||
</if>
|
||||
and is_ds=0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -445,8 +445,8 @@
|
|||
( SELECT COALESCE(SUM(rc.costs), 0) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost,
|
||||
rad2.`status` as dataStatus,
|
||||
mt.unit_value AS unitValue,
|
||||
GROUP_CONCAT(rar.part_name) as partName,
|
||||
GROUP_CONCAT(mpt.pa_name) as partInfo
|
||||
rar.part_name as partName,
|
||||
rar.part_info as partInfo
|
||||
from
|
||||
repair_apply_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
|
|
@ -457,14 +457,26 @@
|
|||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||
left join repair_apply_details rad2 on rad2.task_id=rad.task_id and rad2.ma_id <=> rad.ma_id and rad2.type_id=rad.type_id and rad2.is_ds='1'
|
||||
LEFT JOIN repair_apply_record rar on rar.task_id=rad.task_id and rar.ma_id <=> rad.ma_id and rar.type_id=rad.type_id and rar.is_ds='0'
|
||||
LEFT JOIN ma_part_type mpt on mpt.pa_id=rar.part_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
task_id,
|
||||
ma_id,
|
||||
type_id,
|
||||
GROUP_CONCAT(DISTINCT part_name) AS part_name,
|
||||
GROUP_CONCAT(DISTINCT mpt.pa_name) AS part_info
|
||||
FROM repair_apply_record rar
|
||||
LEFT JOIN ma_part_type mpt ON mpt.pa_id = rar.part_id
|
||||
WHERE rar.is_ds = '0'
|
||||
GROUP BY task_id, ma_id, type_id
|
||||
) rar ON rar.task_id = rad.task_id
|
||||
AND rar.ma_id <=> rad.ma_id
|
||||
AND rar.type_id = rad.type_id
|
||||
]]>
|
||||
<if test="userId != null">
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_repair mtr
|
||||
ON mtr.type_id = rad.type_id
|
||||
AND mtr.user_id = #{userId}
|
||||
</if>
|
||||
</if>
|
||||
where
|
||||
rad.task_id = #{taskId}
|
||||
and rad.is_ds=0
|
||||
|
|
|
|||
Loading…
Reference in New Issue