| 123456789101112131415161718192021222324252627282930313233343536 |
- <?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="platform.modules.build.dao.WaterDao">
- <select id="findByWaterName" resultType="platform.modules.build.entity.Water">
- select * from y_water where name=#{name}
- <if test="id!=null and id!=''">
- and id!=#{id}
- </if>
- </select>
- <select id="findList" resultType="platform.modules.build.entity.Water">
- select id,name from y_water
- order by create_time desc
- </select>
-
- <select id="findByCondition" resultType="platform.modules.build.entity.Water">
- select
- distinct w.*
- from y_water w
- LEFT JOIN y_contract_water cw on w.id = cw.water_id
- where w.del_flag = 0 and cw.del_flag = 0
- <if test="condition.keyword!=null and condition.keyword!=''">
- and
- (
- (w.name like CONCAT ('%',#{condition.keyword},'%'))
- or
- (cw.company_id in (Select c.id from y_company c where c.del_flag = 0 and c.company_name like CONCAT ('%',#{condition.keyword},'%')))
- )
- </if>
- <if test="condition.build_id != null and condition.build_id !='' ">
- and w.build_id = #{condition.build_id}
- </if>
- order by create_time desc
- </select>
- </mapper>
|