EmergencyRepairMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="cn.com.ty.lift.business.emergency.mapper.EmergencyRepairMapper" >
  4. <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.emergency.dto.RepairResponse" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
  7. <result column="lift_id" property="liftId" jdbcType="BIGINT" />
  8. <result column="is_trapped" property="isTrapped" jdbcType="TINYINT" />
  9. <result column="is_critical" property="isCritical" jdbcType="TINYINT" />
  10. <result column="source" property="source" jdbcType="TINYINT" />
  11. <result column="caller_id" property="callerId" jdbcType="BIGINT" />
  12. <result column="caller_tel" property="callerTel" jdbcType="CHAR" />
  13. <result column="caller_date" property="callerDate" jdbcType="TIMESTAMP" />
  14. <result column="stop_date" property="stopDate" jdbcType="TIMESTAMP" />
  15. <result column="recovery_date" property="recoveryDate" jdbcType="TIMESTAMP" />
  16. <result column="charge" property="charge" jdbcType="VARCHAR" />
  17. <result column="worker_id" property="workerId" jdbcType="BIGINT" />
  18. <result column="worker_tel" property="workerTel" jdbcType="CHAR" />
  19. <result column="position" property="position" jdbcType="VARCHAR" />
  20. <result column="status" property="status" jdbcType="TINYINT" />
  21. <result column="creator_id" property="creatorId" jdbcType="BIGINT" />
  22. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  23. <result column="repair_reason" property="repairReason" jdbcType="TINYINT" />
  24. <result column="parts_cost" property="partsCost" jdbcType="DECIMAL" />
  25. <result column="safety_confirm" property="safetyConfirm" jdbcType="VARCHAR" />
  26. <result column="read_time" property="readTime" jdbcType="TIMESTAMP" />
  27. <result column="worker_id1" property="workerId1" jdbcType="BIGINT" />
  28. <result column="wl_floor" property="wlFloor" jdbcType="INTEGER" />
  29. <result column="wl_liftdoor" property="wlLiftdoor" jdbcType="TINYINT" />
  30. <result column="wl_fault" property="wlFault" jdbcType="VARCHAR" />
  31. <result column="wl_fault_reason" property="wlFaultReason" jdbcType="VARCHAR" />
  32. <result column="wl_fault_handle" property="wlFaultHandle" jdbcType="VARCHAR" />
  33. <result column="wl_run_direction" property="wlRunDirection" jdbcType="TINYINT" />
  34. <result column="cost_total" property="costTotal" jdbcType="DECIMAL" />
  35. <result column="project_id" property="projectId" jdbcType="INTEGER" />
  36. <result column="caller_fault_description" property="callerFaultDescription" jdbcType="LONGVARCHAR" />
  37. <result column="sparepart" property="sparepart" jdbcType="LONGVARCHAR" />
  38. <result column="worker_fault_description" property="workerFaultDescription" jdbcType="LONGVARCHAR" />
  39. <result column="field_description" property="fieldDescription" jdbcType="LONGVARCHAR" />
  40. <result column="repair_procedure" property="repairProcedure" jdbcType="LONGVARCHAR" />
  41. <result column="project_name" property="projectName" jdbcType="VARCHAR" />
  42. <result column="area_name" property="areaName" jdbcType="VARCHAR" />
  43. <result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
  44. <result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
  45. <result column="call_name" property="callName" jdbcType="VARCHAR" />
  46. <result column="lift_company_status" property="liftCompanyStatus" jdbcType="VARCHAR" />
  47. </resultMap>
  48. <!--查询急修中-->
  49. <select id="listByRepairing" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.emergency.dto.RepairRequest">
  50. SELECT
  51. er.*,
  52. ui.`name` AS call_name,
  53. li.registration_code,
  54. li.device_position,
  55. pr.project_name,
  56. pclr.lift_company_status
  57. FROM
  58. emergency_repair er
  59. LEFT JOIN user_info ui ON ui.user_id = er.caller_id
  60. LEFT JOIN lift li ON li.id = er.lift_id
  61. LEFT JOIN project pr ON pr.id = er.project_id
  62. LEFT JOIN platform_company_lift_relevance pclr ON pclr.lift_id = li.id
  63. WHERE
  64. er.`status` <![CDATA[ <> ]]> 4
  65. </select>
  66. <!--根据条件查询急修记录-->
  67. <select id="listByCondition" resultMap="BaseResultMap" parameterType="cn.com.ty.lift.business.emergency.dto.RepairRequest" >
  68. SELECT
  69. er.*,
  70. li.registration_code AS registration_code
  71. pr.project_name,
  72. re.area_name
  73. FROM
  74. emergency_repair er
  75. LEFT JOIN project pr ON er.project_id = pr.id
  76. LEFT JOIN region re ON pr.region_id = re.id
  77. LEFT JOIN lift li ON er.lift_id = li.id
  78. WHERE 1 = 1
  79. <if test="condition.projectId != null and condition.projectId > 0">
  80. AND pr.id = #{condition.projectId}
  81. </if>
  82. <if test="condition.regionId != null and condition.regionId > 0">
  83. AND pr.region_id = #{condition.regionId}
  84. </if>
  85. <if test="condition.workerId != null and condition.workerId > 0">
  86. AND er.worker_id = #{condition.workerId}
  87. </if>
  88. <if test="condition.repairBegin != null">
  89. AND er.caller_date &gt; #{condition.repairBegin}
  90. </if>
  91. <if test="condition.repairEnd != null">
  92. AND er.caller_date &lt; #{condition.repairEnd}
  93. </if>
  94. <if test="condition.status != null">
  95. AND er.status = #{condition.status}
  96. </if>
  97. <if test="condition.source != null">
  98. AND er.source = #{condition.source}
  99. </if>
  100. <if test="condition.info != null and condition.info != ''">
  101. AND li.registration_code LIKE #{condition.info}
  102. </if>
  103. </select>
  104. </mapper>