IotProjectTaskMapper.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. <result column="remark" property="remark" />
  15. <result column="manufacture_name" property="manufactureName" />
  16. <result column="contract_name" property="contractName" />
  17. <result column="contract_code" property="contractCode" />
  18. </resultMap>
  19. <select id="taskList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO"
  20. resultMap="IotProjectTaskResultMap">
  21. select
  22. a.id,
  23. a.project_id,
  24. a.well_name,
  25. a.well_type,
  26. a.location,
  27. a.technique,
  28. a.workload_design,
  29. a.create_time,
  30. a.dept_ids,
  31. a.remark,
  32. b.manufacture_name,
  33. b.contract_name,
  34. b.contract_code
  35. from
  36. rqiot.rq_iot_project_task a,
  37. rqiot.rq_iot_project_info b
  38. where 1=1
  39. and a.project_id = b.id
  40. and a.deleted = 0
  41. and b.deleted = 0
  42. <if test="manufactureName != null and manufactureName != ''">
  43. and b.manufacture_name like concat('%', #{manufactureName}, '%')
  44. </if>
  45. <if test="contractName != null and contractName != ''">
  46. and b.contract_name like concat('%', #{contractName}, '%')
  47. </if>
  48. <if test="contractCode != null and contractCode != ''">
  49. and b.contract_code like concat('%', #{contractCode}, '%')
  50. </if>
  51. <if test="wellName != null and wellName != ''">
  52. and a.well_name like concat('%', #{wellName}, '%')
  53. </if>
  54. <if test="createTime != null and createTime.length > 0">
  55. <choose>
  56. <when test="createTime.length == 1">
  57. AND a.create_time = #{createTime[0]}
  58. </when>
  59. <otherwise>
  60. AND a.create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
  61. </otherwise>
  62. </choose>
  63. </if>
  64. <if test="deptIds != null and !deptIds.isEmpty()">
  65. AND a.dept_id IN
  66. <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
  67. #{deptId}
  68. </foreach>
  69. </if>
  70. ORDER BY a.id DESC
  71. </select>
  72. </mapper>