| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.carrier.dao.RentalProjectDao">
- <select id="findList" resultType="platform.modules.carrier.entity.RentalProject">
- SELECT
- ren.id,
- ren.intention_street,
- ren.project_name,
- ren.demand,
- ren.demand_area,
- ren.demand_price,
- ren.floor,
- ren.create_time,
- ren.create_by,
- street.id street_id,
- street.name street_name
- FROM
- ic_rental_project ren
- LEFT JOIN z_user user ON user .id = ren.create_by
- LEFT JOIN y_company company ON company.id = user.company_id
- LEFT JOIN s_street street ON street.id = ren.intention_street
- WHERE
- ren.del_flag != 1
- AND ren.status = 1
- <if test="param.streets != null and param.streets.size()>0">
- AND
- ren.intention_street IN
- <foreach item="item" index="index" collection="param.streets" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="param.industries != null and param.industries.size()>0">
- AND
- company.industry_code IN
- <foreach item="item" index="index" collection="param.industries" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="param.demands != null and param.demands.size()>0">
- AND
- ren.demand IN
- <foreach item="item" index="index" collection="param.demands" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="param.title != null and param.title != '' ">
- AND (
- ren.project_name LIKE CONCAT('%',#{param.title},'%')
- OR company.company_name LIKE CONCAT('%',#{param.title},'%')
- )
- </if>
- <if test="param.industry_code != null and param.industry_code != '' ">
- AND company.industry_code = #{param.industry_code}
- </if>
- <if test="param.demand != null and param.demand != '' ">
- AND ren.demand = #{param.demand}
- </if>
- <if test="param.min_area != null and param.min_area != '' ">
- AND ren.demand_area <![CDATA[>=]]> #{param.min_area}
- </if>
- <if test="param.max_area != null and param.max_area != '' ">
- AND ren.demand_area <![CDATA[<=]]> #{param.max_area}
- </if>
- <if test="param.min_price != null and param.min_price != '' ">
- AND ren.demand_price <![CDATA[>=]]> #{param.min_price}
- </if>
- <if test="param.max_price != null and param.max_price != '' ">
- AND ren.demand_price <![CDATA[<=]]> #{param.max_price}
- </if>
- <if test="param.order_by != null and param.order_by != '' ">
- <if test="param.order_by == null or param.order_by == '' ">
- ORDER BY
- ren.create_time DESC
- </if>
- <if test="param.order_by == 1 ">
- ORDER BY
- ren.create_time DESC
- </if>
- <if test="param.order_by == 2 ">
- ORDER BY
- ren.read_count DESC
- </if>
- </if>
- </select>
- <select id="findListByCreater" resultType="platform.modules.carrier.entity.RentalProject">
- SELECT
- ren.id,
- ren.intention_street,
- ren.project_name,
- ren.demand,
- ren.demand_area,
- ren.demand_area_min,
- ren.demand_area_max,
- ren.floor,
- ren.create_time,
- ren.create_by,
- ren.status
- FROM
- ic_rental_project ren
- LEFT JOIN ic_rental_project_company rpc ON rpc.rental_id = ren.id
- WHERE
- ren.del_flag != 1
- AND
- ren.create_by = #{userId}
- <if test="param.title != null and param.title != '' ">
- AND ren.project_name LIKE CONCAT('%',#{param.title},'%')
- </if>
- <if test="param.min_area != null and param.min_area != ''">
- AND ren.demand_area_min >= #{param.min_area}
- </if>
- <if test="param.max_area != null and param.max_area != ''">
- AND ren.demand_area_max <![CDATA[ <= ]]> #{param.max_area}
- </if>
- <if test="param.min_price != null and param.min_price != ''">
- AND ren.demand_price >= #{param.min_price}
- </if>
- <if test="param.max_price != null and param.max_price != ''">
- AND ren.demand_price <![CDATA[ <= ]]> #{param.max_price}
- </if>
- <if test="param.demand != null and param.demand != ''">
- AND ren.demand = #{param.demand}
- </if>
- <if test="param.industries != null and param.industries.size() > 0">
- AND rpc.industry_code IN
- <foreach collection="param.industries" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- ORDER BY ren.create_time DESC
- </select>
- <update id="updateStatusBatch" parameterType="java.util.List">
- update ic_rental_project
- SET status = #{status}
- WHERE
- <if test="idList.size > 0 ">
- id in
- <foreach collection="idList" open="(" close=")" separator="," item="id">
- #{id}
- </foreach>
- </if>
- </update>
- </mapper>
|