2025-12-09 18:17:37 +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.zhyc.module.work.mapper.WorkOrderMapper" >
<resultMap type= "WorkOrder" id= "WorkOrderResult" >
<result property= "id" column= "id" />
<result property= "orderNo" column= "order_no" />
<result property= "planId" column= "plan_id" />
<result property= "bizType" column= "biz_type" />
<result property= "title" column= "title" />
<result property= "content" column= "content" />
<result property= "department" column= "department" />
<result property= "executorIds" column= "executor_ids" />
2025-12-10 20:27:11 +08:00
<result property= "executor" column= "executor" />
2025-12-09 18:17:37 +08:00
<result property= "executeDate" column= "execute_date" />
<result property= "executeTime" column= "execute_time" />
2025-12-10 20:27:11 +08:00
<result property= "sheepScope" column= "sheep_scope" typeHandler= "com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
<result property= "location" column= "location" typeHandler= "com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
2025-12-09 18:17:37 +08:00
<result property= "materialList" column= "material_list" />
<result property= "toolList" column= "tool_list" />
<result property= "status" column= "status" />
<result property= "priority" column= "priority" />
<result property= "issuerId" column= "issuer_id" />
2025-12-10 20:27:11 +08:00
<result property= "issuer" column= "issuer" />
2025-12-09 18:17:37 +08:00
<result property= "issueTime" column= "issue_time" />
<result property= "receiverId" column= "receiver_id" />
2025-12-10 20:27:11 +08:00
<result property= "receiver" column= "receiver" />
2025-12-09 18:17:37 +08:00
<result property= "receiveTime" column= "receive_time" />
<result property= "finishTime" column= "finish_time" />
<result property= "result" column= "result" />
<result property= "remark" column= "remark" />
<result property= "createTime" column= "create_time" />
<result property= "updateTime" column= "update_time" />
<result property= "deleted" column= "deleted" />
</resultMap>
<sql id= "selectWorkOrderVo" >
2025-12-10 20:27:11 +08:00
select id, order_no, plan_id, biz_type, title, content, department, executor_ids,executor, execute_date, execute_time, sheep_scope, location, material_list, tool_list, status, priority, issuer_id, issuer,issue_time, receiver_id, receiver,receive_time, finish_time, result, remark, create_time, update_time, deleted from work_order
2025-12-09 18:17:37 +08:00
</sql>
<select id= "selectWorkOrderList" parameterType= "WorkOrder" resultMap= "WorkOrderResult" >
<include refid= "selectWorkOrderVo" />
<where >
<if test= "orderNo != null and orderNo != ''" > and order_no like concat('%', #{orderNo}, '%')</if>
<if test= "planId != null " > and plan_id = #{planId}</if>
<if test= "bizType != null " > and biz_type = #{bizType}</if>
2025-12-10 20:27:11 +08:00
<if test= "title != null and title != ''" > and title like coucat('%', #{title},'%')</if>
2025-12-09 18:17:37 +08:00
<if test= "content != null and content != ''" > and content = #{content}</if>
<if test= "department != null and department != ''" > and department = #{department}</if>
2025-12-10 20:27:11 +08:00
<if test= "executor != null and executor != ''" > and executor like coucat('%',#{executor},'%') </if>
<if test= "params.beginPlanDate != null and params.beginPlanDate != '' and params.endPlanDat != null and params.endPlanDate != ''" > and execute_date between #{params.beginPlanDate} and #{params.endPlanDate}</if>
2025-12-09 18:17:37 +08:00
<if test= "executeTime != null and executeTime != ''" > and execute_time = #{executeTime}</if>
<if test= "sheepScope != null and sheepScope != ''" > and sheep_scope = #{sheepScope}</if>
<if test= "location != null and location != ''" > and location = #{location}</if>
<if test= "materialList != null and materialList != ''" > and material_list = #{materialList}</if>
<if test= "toolList != null and toolList != ''" > and tool_list = #{toolList}</if>
<if test= "status != null " > and status = #{status}</if>
<if test= "priority != null " > and priority = #{priority}</if>
2025-12-10 20:27:11 +08:00
<if test= "issuer != null " > and issuer like concat('%',#{issuer},'%') </if>
2025-12-09 18:17:37 +08:00
<if test= "issueTime != null " > and issue_time = #{issueTime}</if>
<if test= "receiverId != null " > and receiver_id = #{receiverId}</if>
<if test= "receiveTime != null " > and receive_time = #{receiveTime}</if>
2025-12-10 20:27:11 +08:00
<if test= "params.beginDatetime != null and params.beginDatetime != '' and params.endFinishDate != null and params.endFinishDate != ''" > and finish_time between #{params.beginFinishDate} and #{params.endFinishDate}</if>
2025-12-09 18:17:37 +08:00
<if test= "result != null and result != ''" > and result = #{result}</if>
</where>
</select>
<select id= "selectWorkOrderById" parameterType= "Long" resultMap= "WorkOrderResult" >
<include refid= "selectWorkOrderVo" />
where id = #{id}
</select>
<insert id= "insertWorkOrder" parameterType= "WorkOrder" useGeneratedKeys= "true" keyProperty= "id" >
insert into work_order
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "orderNo != null and orderNo != ''" > order_no,</if>
<if test= "planId != null" > plan_id,</if>
<if test= "bizType != null" > biz_type,</if>
<if test= "title != null and title != ''" > title,</if>
<if test= "content != null" > content,</if>
<if test= "department != null and department != ''" > department,</if>
<if test= "executorIds != null and executorIds != ''" > executor_ids,</if>
2025-12-10 20:27:11 +08:00
<if test= "executor != null and executor != ''" > executor,</if>
2025-12-09 18:17:37 +08:00
<if test= "executeDate != null" > execute_date,</if>
<if test= "executeTime != null" > execute_time,</if>
<if test= "sheepScope != null and sheepScope != ''" > sheep_scope,</if>
<if test= "location != null" > location,</if>
<if test= "materialList != null" > material_list,</if>
<if test= "toolList != null" > tool_list,</if>
<if test= "status != null" > status,</if>
<if test= "priority != null" > priority,</if>
<if test= "issuerId != null" > issuer_id,</if>
2025-12-10 20:27:11 +08:00
<if test= "issuer != null" > issuer,</if>
2025-12-09 18:17:37 +08:00
<if test= "issueTime != null" > issue_time,</if>
<if test= "receiverId != null" > receiver_id,</if>
2025-12-10 20:27:11 +08:00
<if test= "receiver != null" > receiver,</if>
2025-12-09 18:17:37 +08:00
<if test= "receiveTime != null" > receive_time,</if>
<if test= "finishTime != null" > finish_time,</if>
2025-12-10 20:27:11 +08:00
<if test= "result != null" > `result`,</if>
2025-12-09 18:17:37 +08:00
<if test= "remark != null" > remark,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "deleted != null" > deleted,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "orderNo != null and orderNo != ''" > #{orderNo},</if>
<if test= "planId != null" > #{planId},</if>
<if test= "bizType != null" > #{bizType},</if>
<if test= "title != null and title != ''" > #{title},</if>
<if test= "content != null" > #{content},</if>
<if test= "department != null and department != ''" > #{department},</if>
<if test= "executorIds != null and executorIds != ''" > #{executorIds},</if>
2025-12-10 20:27:11 +08:00
<if test= "executor != null and executor != ''" > #{executor},</if>
2025-12-09 18:17:37 +08:00
<if test= "executeDate != null" > #{executeDate},</if>
<if test= "executeTime != null" > #{executeTime},</if>
2025-12-10 20:27:11 +08:00
<if test= "sheepScope != null and sheepScope != ''" > #{sheepScope,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},</if>
<if test= "location != null" > #{location,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},</if>
2025-12-09 18:17:37 +08:00
<if test= "materialList != null" > #{materialList},</if>
<if test= "toolList != null" > #{toolList},</if>
<if test= "status != null" > #{status},</if>
<if test= "priority != null" > #{priority},</if>
<if test= "issuerId != null" > #{issuerId},</if>
2025-12-10 20:27:11 +08:00
<if test= "issuer != null" > #{issuer},</if>
2025-12-09 18:17:37 +08:00
<if test= "issueTime != null" > #{issueTime},</if>
<if test= "receiverId != null" > #{receiverId},</if>
2025-12-10 20:27:11 +08:00
<if test= "receiver != null" > #{receiver},</if>
2025-12-09 18:17:37 +08:00
<if test= "receiveTime != null" > #{receiveTime},</if>
<if test= "finishTime != null" > #{finishTime},</if>
<if test= "result != null" > #{result},</if>
<if test= "remark != null" > #{remark},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "deleted != null" > #{deleted},</if>
</trim>
</insert>
<update id= "updateWorkOrder" parameterType= "WorkOrder" >
update work_order
<trim prefix= "SET" suffixOverrides= "," >
<if test= "orderNo != null and orderNo != ''" > order_no = #{orderNo},</if>
<if test= "planId != null" > plan_id = #{planId},</if>
<if test= "bizType != null" > biz_type = #{bizType},</if>
<if test= "title != null and title != ''" > title = #{title},</if>
<if test= "content != null" > content = #{content},</if>
<if test= "department != null and department != ''" > department = #{department},</if>
<if test= "executorIds != null and executorIds != ''" > executor_ids = #{executorIds},</if>
2025-12-10 20:27:11 +08:00
<if test= "executor != null and executor != ''" > executor = #{executor},</if>
2025-12-09 18:17:37 +08:00
<if test= "executeDate != null" > execute_date = #{executeDate},</if>
<if test= "executeTime != null" > execute_time = #{executeTime},</if>
2025-12-10 20:27:11 +08:00
<if test= "sheepScope != null and sheepScope != ''" > sheep_scope = #{sheepScope,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},</if>
<if test= "location != null" > location = #{location,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},</if>
2025-12-09 18:17:37 +08:00
<if test= "materialList != null" > material_list = #{materialList},</if>
<if test= "toolList != null" > tool_list = #{toolList},</if>
<if test= "status != null" > status = #{status},</if>
<if test= "priority != null" > priority = #{priority},</if>
<if test= "issuerId != null" > issuer_id = #{issuerId},</if>
2025-12-10 20:27:11 +08:00
<if test= "issuer != null" > issuer = #{issuer},</if>
2025-12-09 18:17:37 +08:00
<if test= "issueTime != null" > issue_time = #{issueTime},</if>
<if test= "receiverId != null" > receiver_id = #{receiverId},</if>
2025-12-10 20:27:11 +08:00
<if test= "receiver != null" > receiver = #{receiver},</if>
2025-12-09 18:17:37 +08:00
<if test= "receiveTime != null" > receive_time = #{receiveTime},</if>
<if test= "finishTime != null" > finish_time = #{finishTime},</if>
2025-12-10 20:27:11 +08:00
<if test= "result != null" > `result` = #{result},</if>
2025-12-09 18:17:37 +08:00
<if test= "remark != null" > remark = #{remark},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "deleted != null" > deleted = #{deleted},</if>
</trim>
where id = #{id}
</update>
<delete id= "deleteWorkOrderById" parameterType= "Long" >
delete from work_order where id = #{id}
</delete>
<delete id= "deleteWorkOrderByIds" parameterType= "String" >
delete from work_order where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>