IotProjectTaskMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.iocoder.yudao.module.pms.dal.mysql.iotprojecttask.IotProjectTaskMapper">
  4. <resultMap id="IotProjectTaskResultMap" type="cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO">
  5. <id column="id" property="id" />
  6. <result column="project_id" property="projectId" />
  7. <result column="well_name" property="wellName" />
  8. <result column="well_type" property="wellType" />
  9. <result column="location" property="location" />
  10. <result column="technique" property="technique" />
  11. <result column="workload_design" property="workloadDesign" />
  12. <result column="create_time" property="createTime" />
  13. <result column="dept_ids" property="deptIds" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
  14. <!-- 施工状态 -->
  15. <result column="status" property="status" />
  16. <result column="rd_status" property="rdStatus" />
  17. <result column="rig_status" property="rigStatus" />
  18. <result column="repair_status" property="repairStatus" />
  19. <result column="remark" property="remark" />
  20. <result column="manufacture_name" property="manufactureName" />
  21. <result column="contract_name" property="contractName" />
  22. <result column="contract_code" property="contractCode" />
  23. </resultMap>
  24. <select id="taskList" resultMap="IotProjectTaskResultMap">
  25. SELECT
  26. a.id,
  27. a.project_id,
  28. a.well_name,
  29. a.well_type,
  30. a.location,
  31. a.technique,
  32. a.workload_design,
  33. a.create_time,
  34. a.dept_ids,
  35. a.status,
  36. a.rd_status,
  37. a.rig_status,
  38. a.repair_status,
  39. a.remark,
  40. b.manufacture_name,
  41. b.contract_name,
  42. b.contract_code
  43. FROM
  44. rq_iot_project_task a,
  45. rq_iot_project_info b
  46. WHERE 1=1
  47. AND a.project_id = b.id
  48. AND a.deleted = 0
  49. AND b.deleted = 0
  50. AND (a.platform_well = 0 or a.platform_well = 1)
  51. <if test="searchDeptIds != null and !searchDeptIds.isEmpty()">
  52. AND (
  53. <foreach collection="searchDeptIds" item="deptId" separator=" OR ">
  54. a.dept_ids LIKE CONCAT('%', #{deptId}, '%')
  55. </foreach>
  56. )
  57. </if>
  58. <if test="companyId != null and companyId != ''">
  59. AND a.dept_id = #{companyId}
  60. </if>
  61. <if test='platformFlag != null and platformFlag == "Y"'>
  62. AND a.platform_well = 1
  63. </if>
  64. <if test='platformFlag != null and platformFlag == "N"'>
  65. AND a.platform_well = 0
  66. </if>
  67. <if test="manufactureName != null and manufactureName != ''">
  68. AND b.manufacture_name LIKE concat('%', #{manufactureName}, '%')
  69. </if>
  70. <if test="contractName != null and contractName != ''">
  71. AND b.contract_name LIKE concat('%', #{contractName}, '%')
  72. </if>
  73. <if test="contractCode != null and contractCode != ''">
  74. AND b.contract_code LIKE concat('%', #{contractCode}, '%')
  75. </if>
  76. <if test="wellName != null and wellName != ''">
  77. AND a.well_name LIKE concat('%', #{wellName}, '%')
  78. </if>
  79. <if test="createTime != null and createTime.length > 0">
  80. <choose>
  81. <when test="createTime.length == 1">
  82. AND a.create_time = #{createTime[0]}
  83. </when>
  84. <otherwise>
  85. AND a.create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
  86. </otherwise>
  87. </choose>
  88. </if>
  89. <if test="deptIds != null and !deptIds.isEmpty()">
  90. AND a.dept_id IN
  91. <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
  92. #{deptId}
  93. </foreach>
  94. </if>
  95. <if test="projectIds != null and !projectIds.isEmpty()">
  96. AND a.project_id IN
  97. <foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
  98. #{projectId}
  99. </foreach>
  100. </if>
  101. ORDER BY a.id DESC
  102. </select>
  103. </mapper>