| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?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.ElectricDao">
- <select id="findByElectricName" resultType="platform.modules.build.entity.Electric">
- select * from y_electric where name=#{name}
- <if test="id!=null and id!=''">
- and id!=#{id}
- </if>
- </select>
- <select id="findList" resultType="platform.modules.build.entity.Electric">
- select id,name ,is_peak from y_electric
- order by create_time desc
- </select>
-
- <select id="findByCondition" resultType="platform.modules.build.entity.Electric">
- select
- distinct e.*
- from y_electric e
- LEFT JOIN y_contract_electric ce on e.id = ce.electric_id
- where e.del_flag = 0
- <if test="condition.keyword!=null and condition.keyword!=''">
- and
- (
- (e.name like CONCAT ('%',#{condition.keyword},'%'))
- or
- (
- ce.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 e.build_id = #{condition.build_id}
- </if>
- order by create_time desc
- </select>
- </mapper>
|