2024-09-27 15:44:11 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.bonus.material.repair.mapper.RepairApplyDetailsMapper">
|
|
|
|
|
<resultMap type="com.bonus.material.repair.domain.RepairApplyDetails" id="RepairApplyDetailsResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="taskId" column="task_id" />
|
|
|
|
|
<result property="maId" column="ma_id" />
|
|
|
|
|
<result property="typeId" column="type_id" />
|
|
|
|
|
<result property="repairNum" column="repair_num" />
|
|
|
|
|
<result property="repairedNum" column="repaired_num" />
|
|
|
|
|
<result property="scrapNum" column="scrap_num" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="companyId" column="company_id" />
|
|
|
|
|
<result property="backId" column="back_id" />
|
|
|
|
|
<result property="repairer" column="repairer" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRepairApplyDetailsVo">
|
|
|
|
|
select id, task_id, ma_id, type_id, repair_num, repaired_num, scrap_num, status, create_by, create_time, update_by, update_time, remark, company_id, back_id, repairer from repair_apply_details
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectRepairApplyDetailsList" parameterType="com.bonus.material.repair.domain.RepairApplyDetails" resultMap="RepairApplyDetailsResult">
|
|
|
|
|
<include refid="selectRepairApplyDetailsVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="taskId != null "> and task_id = #{taskId}</if>
|
|
|
|
|
<if test="maId != null "> and ma_id = #{maId}</if>
|
|
|
|
|
<if test="typeId != null "> and type_id = #{typeId}</if>
|
|
|
|
|
<if test="repairNum != null "> and repair_num = #{repairNum}</if>
|
|
|
|
|
<if test="repairedNum != null "> and repaired_num = #{repairedNum}</if>
|
|
|
|
|
<if test="scrapNum != null "> and scrap_num = #{scrapNum}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
|
<if test="backId != null "> and back_id = #{backId}</if>
|
|
|
|
|
<if test="repairer != null and repairer != ''"> and repairer = #{repairer}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectRepairApplyDetailsById" parameterType="Long" resultMap="RepairApplyDetailsResult">
|
|
|
|
|
<include refid="selectRepairApplyDetailsVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertRepairApplyDetails" parameterType="com.bonus.material.repair.domain.RepairApplyDetails" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into repair_apply_details
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskId != null">task_id,</if>
|
|
|
|
|
<if test="maId != null">ma_id,</if>
|
|
|
|
|
<if test="typeId != null">type_id,</if>
|
|
|
|
|
<if test="repairNum != null">repair_num,</if>
|
|
|
|
|
<if test="repairedNum != null">repaired_num,</if>
|
|
|
|
|
<if test="scrapNum != null">scrap_num,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
|
|
<if test="backId != null">back_id,</if>
|
|
|
|
|
<if test="repairer != null">repairer,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskId != null">#{taskId},</if>
|
|
|
|
|
<if test="maId != null">#{maId},</if>
|
|
|
|
|
<if test="typeId != null">#{typeId},</if>
|
|
|
|
|
<if test="repairNum != null">#{repairNum},</if>
|
|
|
|
|
<if test="repairedNum != null">#{repairedNum},</if>
|
|
|
|
|
<if test="scrapNum != null">#{scrapNum},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
|
|
<if test="backId != null">#{backId},</if>
|
|
|
|
|
<if test="repairer != null">#{repairer},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateRepairApplyDetails" parameterType="com.bonus.material.repair.domain.RepairApplyDetails">
|
|
|
|
|
update repair_apply_details
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="taskId != null">task_id = #{taskId},</if>
|
|
|
|
|
<if test="maId != null">ma_id = #{maId},</if>
|
|
|
|
|
<if test="typeId != null">type_id = #{typeId},</if>
|
|
|
|
|
<if test="repairNum != null">repair_num = #{repairNum},</if>
|
|
|
|
|
<if test="repairedNum != null">repaired_num = #{repairedNum},</if>
|
|
|
|
|
<if test="scrapNum != null">scrap_num = #{scrapNum},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
|
|
|
|
<if test="backId != null">back_id = #{backId},</if>
|
|
|
|
|
<if test="repairer != null">repairer = #{repairer},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
2024-11-28 17:28:22 +08:00
|
|
|
<select id="getDetailsListByTaskIdAndStatus" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
|
|
|
|
select id,
|
|
|
|
|
ma_id as maId,
|
|
|
|
|
type_id as typeId,
|
|
|
|
|
repair_num as repairNum,
|
|
|
|
|
repaired_num as repairedNum,
|
|
|
|
|
scrap_num as scrapNum,
|
|
|
|
|
company_id as companyId
|
|
|
|
|
from repair_apply_details
|
2024-11-28 18:16:02 +08:00
|
|
|
where task_id = #{taskId} and status = #{status} and sent_to_next_phase = '0'
|
2024-11-28 17:28:22 +08:00
|
|
|
</select>
|
|
|
|
|
|
2024-09-27 15:44:11 +08:00
|
|
|
<delete id="deleteRepairApplyDetailsById" parameterType="Long">
|
|
|
|
|
delete from repair_apply_details where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
2024-11-28 17:28:22 +08:00
|
|
|
<delete id="deleteRepairApplyDetailsByTaskIdAndStatus">
|
|
|
|
|
delete from repair_apply_details where task_id = #{taskId} and status = #{status}
|
|
|
|
|
</delete>
|
|
|
|
|
|
2024-09-27 15:44:11 +08:00
|
|
|
<delete id="deleteRepairApplyDetailsByIds" parameterType="String">
|
|
|
|
|
delete from repair_apply_details where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|