| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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="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" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO"
- 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.remark,
- b.manufacture_name,
- b.contract_name,
- b.contract_code
- from
- rqiot.rq_iot_project_task a,
- rqiot.rq_iot_project_info b
- where 1=1
- and a.project_id = b.id
- and a.deleted = 0
- and b.deleted = 0
- <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>
- ORDER BY a.id DESC
- </select>
- </mapper>
|