| | |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="work_order_no" property="workOrderNo"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="unit_name" property="unitName"/> |
| | | <result column="unit_contact" property="unitContact"/> |
| | | <result column="unit_contact_phone" property="unitContactPhone"/> |
| | | <result column="yw_people_id" property="ywPeopleId"/> |
| | | <result column="yw_handle_time" property="ywHandleTime"/> |
| | | <result column="yw_result" property="ywResult"/> |
| | |
| | | |
| | | <select id="page" resultMap="BaseResultMap"> |
| | | SELECT |
| | | wo.id,wo.status, wo.work_order_no, wo.serial_number,wo.create_time, wo.unit_id, wo.yw_people_id, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, |
| | | wo.id,wo.status, |
| | | wo.work_order_no, |
| | | wo.serial_number, |
| | | wo.create_time, |
| | | wo.unit_id, |
| | | wo.yw_people_id, |
| | | wo.yw_handle_time, |
| | | wo.yw_result, |
| | | wo.yw_check_result, |
| | | wo.overtime, |
| | | wo.deduct, |
| | | u.unit_name, |
| | | u.unit_contact, |
| | | u.unit_contact_phone, |
| | | p.yw_person_name, |
| | | tm.name as source, |
| | | GROUP_CONCAT(DISTINCT da.dict_label ORDER BY da.dict_label SEPARATOR ',') AS errorType, |
| | | GROUP_CONCAT(DISTINCT ci.img_url ORDER BY ci.create_time DESC SEPARATOR ',') AS imgListStr |
| | | FROM |
| | | t_work_order wo |
| | | INNER JOIN t_monitor tm ON wo.serial_number = tm.serial_number |
| | | INNER JOIN t_work_order_error_type et ON wo.work_order_no = et.work_order_no |
| | | INNER JOIN t_yw_unit u ON wo.unit_id = u.id AND u.deleted = 0 |
| | | INNER JOIN sys_dict_data da ON da.dict_value = et.error_name AND da.dict_type = 'error_type' |
| | | LEFT JOIN t_work_order_check_img ci ON ci.work_order_no = wo.work_order_no |
| | | LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id AND p.deleted = 0 |
| | | WHERE |
| | | wo.deleted = 0 and wo.status != 'WAIT_DISTRIBUTE' |
| | | <if test="query.unitId != null"> |
| | | AND wo.unit_id = #{query.unitId} |
| | | </if> |
| | | <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 in |
| | | <foreach collection="query.errorTypeList" open="(" separator="," close=")" item="errorType">#{errorType}</foreach> |
| | | )) |
| | | </if> |
| | | <if test="query.keyword != null and query.keyword != ''"> |
| | | AND (wo.work_order_no like concat('%', #{query.keyword}, '%') or tm.name like concat('%', #{query.keyword}, '%') or wo.serial_number like concat('%', #{query.keyword}, '%')) |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND wo.status = #{query.status} |
| | | </if> |
| | | <if test="query.start != null and query.end != null"> |
| | | AND wo.create_time BETWEEN #{query.start} AND #{query.end} |
| | | </if> |
| | | GROUP BY |
| | | wo.id, wo.status, wo.work_order_no, wo.serial_number,wo.create_time, wo.unit_id, wo.yw_people_id,tm.name, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, |
| | | u.unit_name, |
| | | p.yw_person_name |
| | | ORDER BY wo.work_order_no DESC |
| | | </select> |
| | | |
| | | <select id="export" resultMap="BaseResultMap"> |
| | | SELECT |
| | | wo.id,wo.status, |
| | | wo.work_order_no, |
| | | wo.serial_number, |
| | | wo.create_time, |
| | | wo.unit_id, |
| | | wo.yw_people_id, |
| | | wo.yw_handle_time, |
| | | wo.yw_result, |
| | | wo.yw_check_result, |
| | | wo.overtime, |
| | | wo.deduct, |
| | | u.unit_name, |
| | | p.yw_person_name, |
| | | tm.name as source, |
| | |
| | | <if test="query.unitId != null"> |
| | | AND wo.unit_id = #{query.unitId} |
| | | </if> |
| | | <if test="query.workOrderNo != null and query.workOrderNo != ''"> |
| | | AND wo.work_order_no = #{query.workOrderNo} |
| | | <if test="query.keyword != null and query.keyword != ''"> |
| | | AND (wo.work_order_no like concat('%', #{query.keyword}, '%') or tm.name like concat('%', #{query.keyword}, '%')) |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND wo.status = #{query.status} |
| | | </if> |
| | | <if test="query.status == null or query.status == ''"> |
| | | AND wo.status = 'DISTRIBUTED' |
| | | </if> |
| | | <if test="query.start != null"> |
| | | AND wo.yw_handle_time BETWEEN #{query.start} AND #{query.end} |
| | | <if test="query.start != null and query.end != null"> |
| | | AND wo.create_time BETWEEN #{query.start} AND #{query.end} |
| | | </if> |
| | | GROUP BY |
| | | wo.id, wo.status, wo.work_order_no, wo.serial_number,wo.create_time, wo.unit_id, wo.yw_people_id,tm.name, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, |
| | | u.unit_name, |
| | | p.yw_person_name |
| | | ORDER BY wo.create_time DESC |
| | | ORDER BY wo.work_order_no DESC |
| | | </select> |
| | | |
| | | <select id="distributePage" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> |
| | |
| | | wo.id,wo.status, wo.work_order_no,wo.create_time, wo.unit_id, wo.yw_people_id, wo.yw_handle_time, wo.yw_result, wo.yw_check_result, wo.overtime, wo.deduct, |
| | | u.unit_name, |
| | | p.yw_person_name, |
| | | yp.serial_number, |
| | | yp.province_tag, |
| | | yp.important_tag, |
| | | yp.important_command_image_tag, |
| | |
| | | LEFT JOIN t_yw_point p ON w.serial_number = p.serial_number AND p.deleted = 0 |
| | | WHERE w.deleted = 0 |
| | | <if test="dataScope == 1"> AND p.province_tag = 1 </if> |
| | | <if test="dataScope == 3"> AND p.important_tag = 1 </if> |
| | | <if test="dataScope == 3"> AND p.dept_tag = 1 </if> |
| | | <if test="deptId != null"> AND p.dept_id = #{deptId} </if> |
| | | </select> |
| | | |
| | |
| | | LEFT JOIN t_work_order w ON w.serial_number = p.serial_number AND w.deleted = 0 |
| | | WHERE d.del_flag = 0 AND d.area IS NOT NULL |
| | | <if test="dataScope == 1"> AND p.province_tag = 1 </if> |
| | | <if test="dataScope == 3"> AND p.important_tag = 1 </if> |
| | | <if test="dataScope == 3"> AND p.dept_tag = 1 </if> |
| | | <!-- <if test="deptId != null"> AND p.dept_id = #{deptId} </if> --> |
| | | GROUP BY d.area, d.dept_id |
| | | ORDER BY d.dept_id |
| | | ORDER BY d.area_code |
| | | </select> |
| | | |
| | | <select id="hasErrorWorkOrderList" resultType="com.ycl.platform.domain.vo.DeviceInfoVO"> |
| | |
| | | FROM |
| | | t_work_order wo |
| | | WHERE |
| | | wo.create_time BETWEEN #{start} AND #{end} |
| | | AND deleted = 0 |
| | | wo.status = 'YW_HANDLE' |
| | | AND wo.deleted = 0 |
| | | </select> |
| | | |
| | | <insert id="addMany"> |
| | |
| | | <result column="status" property="status" typeHandler="com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler"/> |
| | | <result column="error_names" property="errorType"/> |
| | | </resultMap> |
| | | |
| | | <select id="detailByNo" resultType="com.ycl.platform.domain.vo.WorkOrderDetailVO"> |
| | | SELECT |
| | | wo.id, |
| | | wo.work_order_no, |
| | | wo.serial_number, |
| | | dr.create_time as distributeTime, |
| | | m.name as source, |
| | | yw.unit_name, |
| | | yw.unit_contact, |
| | | yw.unit_contact_phone, |
| | | wo.overtime, |
| | | wo.processing_period, |
| | | wo.status |
| | | FROM |
| | | t_work_order wo |
| | | INNER JOIN t_work_order_distribute_record dr ON wo.work_order_no = dr.work_order_no AND dr.deleted = 0 AND wo.work_order_no = #{workOrderNo} |
| | | INNER JOIN t_monitor m ON m.serial_number = wo.serial_number |
| | | LEFT JOIN t_yw_unit yw ON yw.id = wo.unit_id AND yw.deleted = 0 |
| | | </select> |
| | | <select id="getRecoveryInfo" resultType="com.ycl.platform.domain.vo.WorkOrderVO"> |
| | | SELECT |
| | | wo.work_order_no, |
| | | u.unit_name, |
| | | u.unit_contact, |
| | | u.unit_contact_phone, |
| | | p.yw_person_name, |
| | | GROUP_CONCAT(DISTINCT da.dict_label ORDER BY da.dict_label SEPARATOR ',') AS errorType |
| | | FROM |
| | | t_work_order wo |
| | | INNER JOIN t_work_order_error_type et ON wo.work_order_no = et.work_order_no |
| | | INNER JOIN t_yw_unit u ON wo.unit_id = u.id AND u.deleted = 0 |
| | | INNER JOIN sys_dict_data da ON da.dict_value = et.error_name AND da.dict_type = 'error_type' |
| | | LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id AND p.deleted = 0 |
| | | WHERE |
| | | wo.deleted = 0 |
| | | GROUP BY |
| | | wo.work_order_no, |
| | | u.unit_name, |
| | | u.unit_contact, |
| | | u.unit_contact_phone, |
| | | p.yw_person_name |
| | | </select> |
| | | </mapper> |