| | |
| | | <if test="query.unitId != null"> |
| | | AND wo.unit_id = #{query.unitId} |
| | | </if> |
| | | <if test="query.errorType != null and query.errorType != ''"> |
| | | <if test="query.errorTypeList != null and query.errorTypeList.size>0"> |
| | | AND (EXISTS ( |
| | | SELECT 1 |
| | | FROM t_work_order_error_type twoet |
| | | WHERE twoet.work_order_no = wo.work_order_no |
| | | AND twoet.error_name = #{query.errorType} |
| | | AND twoet.error_name in |
| | | <foreach collection="query.errorTypeList" open="(" close=")" separator="," item="errorType"> |
| | | #{errorType} |
| | | </foreach> |
| | | )) |
| | | </if> |
| | | <if test="query.keyword != null and query.keyword != ''"> |
| | |
| | | <if test="query.start != null and query.end != null"> |
| | | AND wo.create_time BETWEEN #{query.start} AND #{query.end} |
| | | </if> |
| | | <if test="query.errorType != null and query.errorType !='' "> |
| | | <if test="query.errorTypeList != null and query.errorTypeList.size>0"> |
| | | AND (EXISTS ( |
| | | SELECT 1 |
| | | FROM t_work_order_error_type twoet |
| | | WHERE twoet.work_order_no = wo.work_order_no |
| | | AND twoet.error_name = #{query.errorType} |
| | | AND twoet.error_name in |
| | | <foreach collection="query.errorTypeList" open="(" close=")" separator="," item="errorType"> |
| | | #{errorType} |
| | | </foreach> |
| | | )) |
| | | </if> |
| | | GROUP BY |
| | |
| | | </insert> |
| | | |
| | | <select id="selectPassOrder" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> |
| | | SELECT wo.id,wo.work_order_no,wo.unit_id,woet.error_name as errorType,woet.create_time as distributeTime,woar.create_time as auditTime |
| | | SELECT wo.id,wo.work_order_no,wo.unit_id,woet.error_name as errorType,woet.create_time as distributeTime |
| | | FROM t_work_order wo |
| | | LEFT JOIN t_work_order_error_type woet ON woet.work_order_no = wo.work_order_no |
| | | LEFT JOIN t_work_order_auditing_record woar ON woar.work_order_no = wo.work_order_no |
| | | WHERE wo.deleted = 0 AND wo.status = #{status} AND woar.result = #{auditStatus} |
| | | AND wo.deduct = 0 AND woar.create_time between #{startTime} and #{endTime} |
| | | LEFT JOIN t_work_order_auditing_record woar ON woar.work_order_no = wo.work_order_no and woar.result = #{auditStatus} |
| | | WHERE wo.deleted = 0 AND wo.deduct = 0 AND wo.status = #{status} |
| | | AND woet.error_name in |
| | | <foreach collection="errorList" item="error" separator="," open="(" close=")"> |
| | | #{error} |
| | | </foreach> |
| | | AND woar.create_time between #{startTime} and #{endTime} |
| | | </select> |
| | | |
| | | <update id="updateMany"> |
| | |
| | | </foreach> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getAuditTimeList" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> |
| | | select work_order_no ,create_time as auditTime from t_work_order_auditing_record where work_order_no in |
| | | <foreach collection="workOrderNos" item="no" open="(" close=")" separator=","> |
| | | #{no} |
| | | </foreach> |
| | | </select> |
| | | <select id="getHandleTimeList" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> |
| | | select work_order_no ,create_time as handleTime from t_work_order_yw_condition_record |
| | | where sys_msg = 0 and work_order_no in |
| | | <foreach collection="workOrderNos" item="no" open="(" close=")" separator=","> |
| | | #{no} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |