| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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">
- <!--
- 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
- 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
- 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
- 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
- -->
- <select id="taskList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO"
- resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO">
- 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.wellName 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>
|