| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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="com.template.mapper.HousePriceMapper">
- <select id="alterPriceRecord" resultType="com.template.model.vo.AlterPriceRecordVo">
- SELECT t2.room_type as houseType,
- t2.room_name AS houseName,
- group_concat(REPLACE(t1.set_date, ',', ' 至 ')) AS setDate,
- t1.price AS alterPrice,
- t1.original_price AS originalPrice,
- a.name as `name`,
- t1.create_time as date
- FROM house_price t1
- LEFT JOIN house t2 ON t1.house_id = t2.id
- and t2.deleted = 0
- LEFT JOIN admin a on a.id = t1.create_user
- and a.deleted = 0
- <where>
- t1.deleted = 0
- <if test="type != null and type != ''">
- AND t2.room_type = #{type}
- </if>
- <if test="houseName != null and houseName != ''">
- AND t2.room_name = #{houseName}
- </if>
- <if test="operatingTime != null and operatingTime != ''">
- AND t1.create_time BETWEEN SUBSTRING_INDEX(#{operatingTime}, ',', 1) and
- SUBSTRING_INDEX(#{operatingTime}, ',', -1)
- </if>
- <if test="priceTime != null and priceTime != ''">
- AND (substring_index(t1.set_date, ',', 1) BETWEEN SUBSTRING_INDEX(#{priceTime}, ',', 1) and
- SUBSTRING_INDEX(#{priceTime}, ',', -1)
- or
- substring_index(t1.set_date, ',', -1) BETWEEN SUBSTRING_INDEX(#{priceTime}, ',', 1) and
- SUBSTRING_INDEX(#{priceTime}, ',', -1)
- )
- </if>
- <if test="operatingName != null and operatingName != ''">
- AND a.`name` LIKE '%' #{operatingName} '%'
- </if>
- </where>
- GROUP BY t1.id
- ORDER BY t1.create_time DESC
- </select>
- </mapper>
|