|
@@ -0,0 +1,140 @@
|
|
|
+<?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.tofly.zmrq.mapper.SchedulerMapper">
|
|
|
+ <resultMap id="schedulerMap" type="com.tofly.zmrq.entity.Scheduler">
|
|
|
+ <id property="id" column="ID"/>
|
|
|
+ <result property="emergencyHandling" column="EMERGENCY_HANDLING"/>
|
|
|
+ <result property="mdispatchingDepartment" column="MDISPATCHING_DEPARTMENT"/>
|
|
|
+ <result property="mdispatchingUserId" column="MDISPATCHING_USER_ID"/>
|
|
|
+ <result property="assistantDepartment" column="ASSISTANT_DEPARTMENT"/>
|
|
|
+ <result property="assistantUserId" column="ASSISTANT_USER_ID"/>
|
|
|
+ <result property="checkUserId" column="CHECK_USER_ID"/>
|
|
|
+ <result property="mdispatchingNotes" column="MDISPATCHING_NOTES"/>
|
|
|
+ <result property="delFlag" column="DEL_FLAG"/>
|
|
|
+ <result property="createUser" column="CREATE_USER"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="workOrderState" column="WORK_ORDER_STATE"/>
|
|
|
+ <result property="x" column="X"/>
|
|
|
+ <result property="y" column="Y"/>
|
|
|
+ <result property="alarmPeopleName" column="ALARM_PEOPLE_NAME"/>
|
|
|
+ <result property="address" column="ADDRESS"/>
|
|
|
+ <result property="contactPhone" column="CONTACT_PHONE"/>
|
|
|
+ <result property="type" column="TYPE"/>
|
|
|
+ <result property="departmentId" column="DEPARTMENT_ID"/>
|
|
|
+ <result property="dispatchUserId" column="DISPATCH_USER_ID"/>
|
|
|
+ <result property="description" column="DESCRIPTION"/>
|
|
|
+ <result property="isMaintenance" column="IS_MAINTENANCE"/>
|
|
|
+ <result property="overTime" column="OVER_TIME"/>
|
|
|
+ <result property="completeTime" column="COMPLETE_TIME"/>
|
|
|
+ <result property="checkTime" column="CHECK_TIME"/>
|
|
|
+ <result property="maintenanceTime" column="MAINTENANCE_TIME"/>
|
|
|
+ <result property="responsibleDepartment" column="RESPONSIBLE_DEPARTMENT"/>
|
|
|
+ <result property="responsibleUserId" column="RESPONSIBLE_USER_ID"/>
|
|
|
+ <result property="maintenanceNotes" column="MAINTENANCE_NOTES"/>
|
|
|
+ <result property="companyId" column="COMPANY_ID"/>
|
|
|
+ <association property="companyName" column="COMPANY_ID" select="com.tofly.common.mapper.ToflyCodeCommonMapper.getCompanyName"></association>
|
|
|
+ <association property="checkUserName" column="CHECK_USER_ID" select="com.tofly.common.mapper.ToflyCodeCommonMapper.getUserName"></association>
|
|
|
+ <association property="dispatchUserName" column="DISPATCH_USER_ID" select="com.tofly.common.mapper.ToflyCodeCommonMapper.getUserName"></association>
|
|
|
+ <association property="responsibleUserName" column="RESPONSIBLE_USER_ID" select="com.tofly.common.mapper.ToflyCodeCommonMapper.getUserName"></association>
|
|
|
+ <association property="createUserName" javaType="java.lang.String" column="CREATE_USER" select="com.tofly.common.mapper.ToflyCodeCommonMapper.getUserName"></association>
|
|
|
+ <association property="responsibleDepartmentName" javaType="java.lang.String" column="RESPONSIBLE_DEPARTMENT" select="getdepartmentName"></association>
|
|
|
+ <association property="workOrderStateName" column="WORK_ORDER_STATE" select="getworkOrderStateName"></association>
|
|
|
+ <association property="typeName" column="TYPE" select="gettypeName"></association>
|
|
|
+ <association property="mdispatchingUserName" javaType="java.lang.String" column="MDISPATCHING_USER_ID" select="getmdispatchingUserName"></association>
|
|
|
+ <association property="mdispatchingDepartmentName" javaType="java.lang.String" column="MDISPATCHING_DEPARTMENT" select="getmdispatchingDepartmentName"></association>
|
|
|
+ <association property="assistantUserName" javaType="java.lang.String" column="ASSISTANT_USER_ID" select="getassistantUserName"></association>
|
|
|
+ <association property="assistantDepartmentName" javaType="java.lang.String" column="ASSISTANT_DEPARTMENT" select="getassistantDepartmentName"></association>
|
|
|
+ <collection property="takeOrderFile" column="ID" select="gettakeOrderFile" ofType="java.util.List"></collection>
|
|
|
+ <collection property="emergencyVoice" column="ID" select="getemergencyVoice" ofType="java.util.List"></collection>
|
|
|
+ <collection property="emergencyFile" column="ID" select="getemergencyFile" ofType="java.util.List"></collection>
|
|
|
+ <collection property="confirmingTheLink" column="ID" select="getconfirmingTheLink" ofType="java.util.List"></collection>
|
|
|
+ <collection property="mdispatchingFile" column="ID" select="getmdispatchingFile" ofType="java.util.List"></collection>
|
|
|
+ <collection property="maintenanceVoice" column="ID" select="getmaintenanceVoice" ofType="java.util.List"></collection>
|
|
|
+ <collection property="maintenanceFile" column="ID" select="getmaintenanceFile" ofType="java.util.List"></collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="fileMap" type="java.util.Map">
|
|
|
+ <result property="path" column="FILE_PATH"/>
|
|
|
+ <result property="fileName" column="FILE_NAME"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="getworkOrderStateName" resultType="java.lang.Object">
|
|
|
+ select decode(#{workOrderState},'1','待工单执行回报','2','待审核','3','3待抢修','4','工单完成') as workOrderStateName from dual
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="gettypeName" resultType="java.lang.Object">
|
|
|
+ select decode(#{type},'0','非漏气','1','漏气') as typeName from dual
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="gettakeOrderFile" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER_FILE f where f.scheduler_id =#{ID} and f.process_id = '1'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getemergencyVoice" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER s,TF_SCHEDULER_FILE f where s.id = f.scheduler_id and
|
|
|
+ ((f.scheduler_id =#{ID} and f.file_type = 1 and f.process_id = '2')
|
|
|
+ or (s.is_maintenance = '0' and f.scheduler_id =#{ID} and f.file_type = 1 and f.process_id = '4'))
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getemergencyFile" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER s,TF_SCHEDULER_FILE f where s.id = f.scheduler_id and
|
|
|
+ ((f.scheduler_id =#{ID} and f.file_type = 0 and f.process_id = '2')
|
|
|
+ or (s.is_maintenance = '0' and f.scheduler_id =#{ID} and f.file_type = 0 and f.process_id = '4'))
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getconfirmingTheLink" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER s, TF_SCHEDULER_FILE f where
|
|
|
+ s.id = f.scheduler_id and s.is_maintenance = '0' and s.id =#{ID} and f.file_type = 3 and f.process_id = '4'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getmdispatchingFile" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER_FILE f where f.scheduler_id =#{ID} and f.file_type = 0 and f.process_id = '3'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getmaintenanceVoice" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER s,TF_SCHEDULER_FILE f where s.id = f.scheduler_id and
|
|
|
+ s.is_maintenance = '1' and f.scheduler_id =#{ID} and f.file_type = 1 and f.process_id = '4'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getmaintenanceFile" resultMap="fileMap">
|
|
|
+ select f.file_path,f.file_name from TF_SCHEDULER s,TF_SCHEDULER_FILE f where s.id = f.scheduler_id and
|
|
|
+ s.is_maintenance = '1' and f.scheduler_id =#{ID} and f.file_type = 0 and f.process_id = '4'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getdepartmentName" resultType="java.lang.Object">
|
|
|
+ select name as departmentName from tf_smpn_department_x where id = #{responsibleDepartment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getmdispatchingUserName" resultType="java.lang.String">
|
|
|
+ select LISTAGG(b.real_name,',') within group(order by b.real_name) from
|
|
|
+ (select regexp_substr(#{MDISPATCHING_USER_ID}, '[^,]+', 1, rownum) as id
|
|
|
+ from dual
|
|
|
+ <![CDATA[ connect by rownum <= REGEXP_COUNT(#{MDISPATCHING_USER_ID}, '[^,]+') ) a ]]>
|
|
|
+ left join tf_smpn_user_x b on a.id = b.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getmdispatchingDepartmentName" resultType="java.lang.String">
|
|
|
+ select LISTAGG(b.name,',') within group(order by b.name) from
|
|
|
+ (select regexp_substr(#{MDISPATCHING_DEPARTMENT}, '[^,]+', 1, rownum) as id
|
|
|
+ from dual
|
|
|
+ <![CDATA[ connect by rownum <= REGEXP_COUNT(#{MDISPATCHING_DEPARTMENT}, '[^,]+') ) a ]]>
|
|
|
+ left join tf_smpn_department_x b on a.id = b.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getassistantUserName" resultType="java.lang.String">
|
|
|
+ select LISTAGG(b.real_name,',') within group(order by b.real_name) from
|
|
|
+ (select regexp_substr(#{ASSISTANT_USER_ID}, '[^,]+', 1, rownum) as id
|
|
|
+ from dual
|
|
|
+ <![CDATA[ connect by rownum <= REGEXP_COUNT(#{ASSISTANT_USER_ID}, '[^,]+') ) a ]]>
|
|
|
+ left join tf_smpn_user_x b on a.id = b.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getassistantDepartmentName" resultType="java.lang.String">
|
|
|
+ select LISTAGG(b.name,',') within group(order by b.name) from
|
|
|
+ (select regexp_substr(#{ASSISTANT_DEPARTMENT}, '[^,]+', 1, rownum) as id
|
|
|
+ from dual
|
|
|
+ <![CDATA[ connect by rownum <= REGEXP_COUNT(#{ASSISTANT_DEPARTMENT}, '[^,]+') ) a ]]>
|
|
|
+ left join tf_smpn_department_x b on a.id = b.id
|
|
|
+ </select>
|
|
|
+</mapper>
|