IotProjectTaskMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. rq_iot_project_task a,
  37. 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. and (a.platform_well = 0 or a.platform_well = 1)
  43. <if test="manufactureName != null and manufactureName != ''">
  44. and b.manufacture_name like concat('%', #{manufactureName}, '%')
  45. </if>
  46. <if test="contractName != null and contractName != ''">
  47. and b.contract_name like concat('%', #{contractName}, '%')
  48. </if>
  49. <if test="contractCode != null and contractCode != ''">
  50. and b.contract_code like concat('%', #{contractCode}, '%')
  51. </if>
  52. <if test="wellName != null and wellName != ''">
  53. and a.well_name like concat('%', #{wellName}, '%')
  54. </if>
  55. <if test="createTime != null and createTime.length > 0">
  56. <choose>
  57. <when test="createTime.length == 1">
  58. AND a.create_time = #{createTime[0]}
  59. </when>
  60. <otherwise>
  61. AND a.create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
  62. </otherwise>
  63. </choose>
  64. </if>
  65. <if test="deptIds != null and !deptIds.isEmpty()">
  66. AND a.dept_id IN
  67. <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
  68. #{deptId}
  69. </foreach>
  70. </if>
  71. ORDER BY a.id DESC
  72. </select>
  73. </mapper>