| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?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="cn.iocoder.yudao.module.pms.dal.mysql.iotprojecttask.IotProjectTaskMapper">
- <resultMap id="IotProjectTaskResultMap" type="cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO">
- <id column="id" property="id" />
- <result column="project_id" property="projectId" />
- <result column="well_name" property="wellName" />
- <result column="well_type" property="wellType" />
- <result column="location" property="location" />
- <result column="technique" property="technique" />
- <result column="workload_design" property="workloadDesign" />
- <result column="create_time" property="createTime" />
- <result column="dept_ids" property="deptIds" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
- <!-- 施工状态 -->
- <result column="status" property="status" />
- <result column="rd_status" property="rdStatus" />
- <result column="rig_status" property="rigStatus" />
- <result column="repair_status" property="repairStatus" />
- <result column="remark" property="remark" />
- <result column="manufacture_name" property="manufactureName" />
- <result column="contract_name" property="contractName" />
- <result column="contract_code" property="contractCode" />
- </resultMap>
- <select id="taskList" resultMap="IotProjectTaskResultMap">
- SELECT
- a.id,
- a.project_id,
- a.well_name,
- a.well_type,
- a.location,
- a.technique,
- a.workload_design,
- a.create_time,
- a.dept_ids,
- a.status,
- a.rd_status,
- a.rig_status,
- a.repair_status,
- a.remark,
- b.manufacture_name,
- b.contract_name,
- b.contract_code
- FROM
- rq_iot_project_task a,
- rq_iot_project_info b
- WHERE 1=1
- AND a.project_id = b.id
- AND a.deleted = 0
- AND b.deleted = 0
- AND (a.platform_well = 0 or a.platform_well = 1)
- <if test="searchDeptIds != null and !searchDeptIds.isEmpty()">
- AND (
- <foreach collection="searchDeptIds" item="deptId" separator=" OR ">
- a.dept_ids LIKE CONCAT('%', #{deptId}, '%')
- </foreach>
- )
- </if>
- <if test="companyId != null and companyId != ''">
- AND a.dept_id = #{companyId}
- </if>
- <if test='platformFlag != null and platformFlag == "Y"'>
- AND a.platform_well = 1
- </if>
- <if test='platformFlag != null and platformFlag == "N"'>
- AND a.platform_well = 0
- </if>
- <if test="manufactureName != null and manufactureName != ''">
- AND b.manufacture_name LIKE concat('%', #{manufactureName}, '%')
- </if>
- <if test="contractName != null and contractName != ''">
- AND b.contract_name LIKE concat('%', #{contractName}, '%')
- </if>
- <if test="contractCode != null and contractCode != ''">
- AND b.contract_code LIKE concat('%', #{contractCode}, '%')
- </if>
- <if test="wellName != null and wellName != ''">
- AND a.well_name LIKE concat('%', #{wellName}, '%')
- </if>
- <if test="createTime != null and createTime.length > 0">
- <choose>
- <when test="createTime.length == 1">
- AND a.create_time = #{createTime[0]}
- </when>
- <otherwise>
- AND a.create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
- </otherwise>
- </choose>
- </if>
- <if test="deptIds != null and !deptIds.isEmpty()">
- AND a.dept_id IN
- <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
- #{deptId}
- </foreach>
- </if>
- <if test="projectIds != null and !projectIds.isEmpty()">
- AND a.project_id IN
- <foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
- #{projectId}
- </foreach>
- </if>
- ORDER BY a.id DESC
- </select>
- </mapper>
|