zhwl/zhwl-business/zhwl-hotel-homestay/target/classes/mapper/hotelhomestay/ZdyHotelHomestayRoomClassifyMapper.xml
2025-07-01 17:54:58 +08:00

811 lines
32 KiB
XML

<?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.zhwl.hotel.homestay.mapper.ZdyHotelHomestayRoomClassifyMapper">
<resultMap type="ZdyHotelHomestayRoomClassify" id="ZdyHotelHomestayRoomClassifyResult">
<result property="id" column="id"/>
<result property="hotelHomestayId" column="hotel_homestay_id"/>
<result property="level1Name" column="level1_name"/>
<result property="level2Name" column="level2_name"/>
<result property="image" column="image"/>
<result property="weekdayPrice" column="weekday_price"/>
<result property="weekendPrice" column="weekend_price"/>
<result property="limitedLivePerson" column="limited_live_person"/>
<result property="cancelRuleType" column="cancel_rule_type"/>
<result property="cancelRuleContent" column="cancel_rule_content"/>
<result property="area" column="area"/>
<result property="bedType" column="bed_type"/>
<result property="window" column="window"/>
<result property="wifi" column="wifi"/>
<result property="floor" column="floor"/>
<result property="breakfast" column="breakfast"/>
<result property="delFlag" column="del_flag"/>
<result property="deptId" column="dept_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="submitTime" column="submit_time"/>
<result property="auditStatus" column="audit_status"/>
<result property="auditTime" column="audit_time"/>
<result property="rejectReason" column="reject_reason"/>
<result property="grounding" column="grounding"/>
<result property="flag" column="flag"/>
<result property="sort" column="sort"/>
</resultMap>
<resultMap type="ZdyHotelHomestayRoomClassifyVO" id="ZdyHotelHomestayRoomClassifyVOResult">
<result property="id" column="id"/>
<result property="hotelHomestayId" column="hotel_homestay_id"/>
<result property="level1Name" column="level1_name"/>
<result property="level2Name" column="level2_name"/>
<result property="image" column="image"/>
<result property="weekdayPrice" column="weekday_price"/>
<result property="weekendPrice" column="weekend_price"/>
<result property="limitedLivePerson" column="limited_live_person"/>
<result property="cancelRuleType" column="cancel_rule_type"/>
<result property="cancelRuleContent" column="cancel_rule_content"/>
<result property="area" column="area"/>
<result property="bedType" column="bed_type"/>
<result property="window" column="window"/>
<result property="wifi" column="wifi"/>
<result property="floor" column="floor"/>
<result property="breakfast" column="breakfast"/>
<result property="delFlag" column="del_flag"/>
<result property="deptId" column="dept_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="quantity" column="quantity"/>
<result property="submitTime" column="submit_time"/>
<result property="auditStatus" column="audit_status"/>
<result property="auditTime" column="audit_time"/>
<result property="rejectReason" column="reject_reason"/>
<result property="grounding" column="grounding"/>
<result property="flag" column="flag"/>
<result property="sort" column="sort"/>
<result property="hotelHomestayName" column="hotel_homestay_name"/>
</resultMap>
<resultMap type="com.zhwl.hotel.homestay.domain.vo.ZdyHotelHomestayRoomClassifyPriceVO"
id="ZdyHotelHomestayRoomPriceVOResult">
<result property="hotelHomestayRoomClassifyId" column="hotel_homestay_room_classify_id"/>
<result property="weekdayPrice" column="weekday_price"/>
<result property="weekendPrice" column="weekend_price"/>
<result property="level1Name" column="level1_name"/>
<result property="level2Name" column="level2_name"/>
<collection property="roomPriceInnerVOS" javaType="java.util.List"
ofType="com.zhwl.hotel.homestay.domain.vo.ZdyHotelHomestayRoomClassifyPriceInnerVO"
resultMap="roomNewPrice">
</collection>
</resultMap>
<resultMap id="roomNewPrice" type="ZdyHotelHomestayRoomClassifyPriceInnerVO">
<result property="roomClassifyId" column="room_classify_id"/>
<result property="recordDate" column="record_date"/>
<result property="newPrice" column="new_price"/>
</resultMap>
<sql id="selectZdyHotelHomestayRoomClassifyVo">
select id,
hotel_homestay_id,
level1_name,
level2_name,
image,
weekday_price,
weekend_price,
limited_live_person,
cancel_rule_type,
cancel_rule_content,
area,
bed_type,
window,
wifi,
floor,
breakfast,
del_flag,
dept_id,
create_by,
create_time,
update_by,
update_time,
remark,
submit_time,
audit_status,
audit_time,
reject_reason,
grounding,
flag,
sort
from zdy_hotel_homestay_room_classify rc
</sql>
<select id="selectZdyHotelHomestayRoomClassifyList" parameterType="ZdyHotelHomestayRoomClassify"
resultMap="ZdyHotelHomestayRoomClassifyVOResult">
select
rc.id,
rc.hotel_homestay_id,
rc.level1_name,
rc.level2_name,
rc.image,
rc.weekday_price,
rc.weekend_price,
rc.limited_live_person,
rc.cancel_rule_type,
rc.cancel_rule_content,
rc.area,
rc.bed_type,
rc.window,
rc.wifi,
rc.floor,
rc.breakfast,
rc.del_flag,
rc.dept_id,
rc.create_by,
rc.create_time,
rc.update_by,
rc.update_time,
rc.remark,
rc.submit_time,
rc.audit_status,
rc.audit_time,
rc.reject_reason,
rc.grounding,
rc.flag,
rc.sort,
sbi.name hotel_homestay_name,
(select ifnull(sum(ifnull(quantity, 0)), 0)
from zdy_hotel_homestay_room r
where r.hotel_homestay_room_classify_id = rc.id and r.del_flag = '0') quantity
from zdy_hotel_homestay_room_classify rc
left join zdy_hotel_homestay zhh on zhh.id=rc.hotel_homestay_id
left join zdy_store_base_info sbi on sbi.id = zhh.store_id
<where>
and rc.del_flag = '0'
<if test="hotelHomestayId != null ">
and rc.hotel_homestay_id = #{hotelHomestayId}
</if>
<if test="level1Name != null and level1Name != ''">
and rc.level1_name like concat('%', #{level1Name}, '%')
</if>
<if test="level2Name != null and level2Name != ''">
and rc.level2_name like concat('%', #{level2Name}, '%')
</if>
<if test="image != null and image != ''">
and rc.image = #{image}
</if>
<if test="weekdayPrice != null ">
and rc.weekday_price = #{weekdayPrice}
</if>
<if test="weekendPrice != null ">
and rc.weekend_price = #{weekendPrice}
</if>
<if test="limitedLivePerson != null ">
and rc.limited_live_person = #{limitedLivePerson}
</if>
<if test="cancelRuleType != null ">
and rc.cancel_rule_type = #{cancelRuleType}
</if>
<if test="cancelRuleContent != null and cancelRuleContent != ''">
and rc.cancel_rule_content = #{cancelRuleContent}
</if>
<if test="area != null ">
and rc.area = #{area}
</if>
<if test="bedType != null and bedType != ''">
and rc.bed_type = #{bedType}
</if>
<if test="window != null and window != ''">
and rc.window = #{window}
</if>
<if test="wifi != null and wifi != ''">
and rc.wifi = #{wifi}
</if>
<if test="floor != null and floor != ''">
and rc.floor = #{floor}
</if>
<if test="breakfast != null and breakfast != ''">
and rc.breakfast = #{breakfast}
</if>
<if test="deptId != null ">
and rc.dept_id = #{deptId}
</if>
<if test="auditStatus != null ">
and rc.audit_status = #{auditStatus}
</if>
<if test="grounding != null ">
and rc.grounding = #{grounding}
</if>
<if test="flag != null ">
and rc.flag = #{flag}
</if>
<if test="sort != null ">
and rc.sort = #{sort}
</if>
<if test="params.submitBeginTime != null and params.submitBeginTime != ''"><!-- 开始时间检索 -->
AND date_format(rc.submit_time,'%y%m%d') &gt;= date_format(#{params.submitBeginTime},'%y%m%d')
</if>
<if test="params.submitEndTime != null and params.submitEndTime != ''"><!-- 结束时间检索 -->
AND date_format(rc.submit_time,'%y%m%d') &lt;= date_format(#{params.submitEndTime},'%y%m%d')
</if>
${params.dataScope}
</where>
order by rc.sort asc
</select>
<select id="appSelectZdyHotelHomestayRoomClassifyList"
resultMap="ZdyHotelHomestayRoomClassifyVOResult">
select rc.id,
rc.hotel_homestay_id,
rc.level1_name,
rc.level2_name,
rc.image,
rc.weekday_price,
rc.weekend_price,
rc.limited_live_person,
rc.cancel_rule_type,
rc.cancel_rule_content,
rc.area,
rc.bed_type,
rc.window,
rc.wifi,
rc.floor,
rc.breakfast,
rc.del_flag,
rc.dept_id,
rc.create_by,
rc.create_time,
rc.update_by,
rc.update_time,
rc.remark,
(select ifnull(sum(ifnull(quantity, 0)), 0)
from zdy_hotel_homestay_room r
where r.hotel_homestay_room_classify_id = rc.id
and r.del_flag = '0') quantity
from zdy_hotel_homestay_room_classify rc
left join zdy_hotel_homestay zhh on rc.hotel_homestay_id = zhh.id
left join zdy_store_base_info sbi on sbi.id = zhh.store_id
where rc.del_flag = '0'
and rc.hotel_homestay_id = #{hotelHomestayId}
and rc.audit_status = 2
and rc.grounding = 'up'
and sbi.register_audit_status = 'APPROVED'
and sbi.grounding_status = 'up'
</select>
<select id="selectZdyHotelHomestayRoomClassifyById" parameterType="Long"
resultMap="ZdyHotelHomestayRoomClassifyVOResult">
select rc.id,
rc.hotel_homestay_id,
rc.level1_name,
rc.level2_name,
rc.image,
rc.weekday_price,
rc.weekend_price,
rc.limited_live_person,
rc.cancel_rule_type,
rc.cancel_rule_content,
rc.area,
rc.bed_type,
rc.window,
rc.wifi,
rc.floor,
rc.breakfast,
rc.del_flag,
rc.dept_id,
rc.create_by,
rc.create_time,
rc.update_by,
rc.update_time,
rc.remark,
rc.submit_time,
rc.audit_status,
rc.audit_time,
rc.reject_reason,
rc.grounding,
rc.flag,
rc.sort,
(select ifnull(sum(ifnull(quantity, 0)), 0)
from zdy_hotel_homestay_room r
where r.hotel_homestay_room_classify_id = rc.id
and r.del_flag = '0') quantity,
zhh.name hotel_homestay_name
from zdy_hotel_homestay_room_classify rc
left join zdy_hotel_homestay zhh on zhh.id = rc.hotel_homestay_id
where rc.id = #{id}
and rc.del_flag = '0'
</select>
<select id="selectZdyHotelHomestayRoomClassifyByIds"
resultMap="ZdyHotelHomestayRoomClassifyVOResult">
select rc.id,
rc.hotel_homestay_id,
rc.level1_name,
rc.level2_name,
rc.image,
rc.weekday_price,
rc.weekend_price,
rc.limited_live_person,
rc.cancel_rule_type,
rc.cancel_rule_content,
rc.area,
rc.bed_type,
rc.window,
rc.wifi,
rc.floor,
rc.breakfast,
rc.del_flag,
rc.dept_id,
rc.create_by,
rc.create_time,
rc.update_by,
rc.update_time,
rc.remark,
rc.submit_time,
rc.audit_status,
rc.audit_time,
rc.reject_reason,
rc.grounding,
rc.flag,
rc.sort,
(select ifnull(sum(ifnull(quantity, 0)), 0)
from zdy_hotel_homestay_room r
where r.hotel_homestay_room_classify_id = rc.id and r.del_flag = '0') quantity
from zdy_hotel_homestay_room_classify rc
<where>
and rc.del_flag = '0'
<if test="hotelHomestayId != null">
and hotel_homestay_id = #{hotelHomestayId}
</if>
<if test="ids != null and ids.size() > 0">
and rc.id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</where>
</select>
<insert id="insertZdyHotelHomestayRoomClassify" parameterType="ZdyHotelHomestayRoomClassify" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_hotel_homestay_room_classify
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hotelHomestayId != null">hotel_homestay_id,
</if>
<if test="level1Name != null and level1Name != ''">level1_name,
</if>
<if test="level2Name != null and level2Name != ''">level2_name,
</if>
<if test="image != null and image != ''">image,
</if>
<if test="weekdayPrice != null">weekday_price,
</if>
<if test="weekendPrice != null">weekend_price,
</if>
<if test="limitedLivePerson != null">limited_live_person,
</if>
<if test="cancelRuleType != null">cancel_rule_type,
</if>
<if test="cancelRuleContent != null">cancel_rule_content,
</if>
<if test="area != null">area,
</if>
<if test="bedType != null">bed_type,
</if>
<if test="window != null">window,
</if>
<if test="wifi != null">wifi,
</if>
<if test="floor != null">floor,
</if>
<if test="breakfast != null">breakfast,
</if>
<if test="delFlag != null and delFlag != ''">del_flag,
</if>
<if test="deptId != null">dept_id,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
<if test="submitTime != null">submit_time,
</if>
<if test="auditStatus != null">audit_status,
</if>
<if test="auditTime != null">audit_time,
</if>
<if test="rejectReason != null and rejectReason !='' ">reject_reason,
</if>
<if test="grounding != null ">grounding,
</if>
<if test="flag != null ">flag,
</if>
<if test="sort != null ">sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="hotelHomestayId != null">#{hotelHomestayId},
</if>
<if test="level1Name != null and level1Name != ''">#{level1Name},
</if>
<if test="level2Name != null and level2Name != ''">#{level2Name},
</if>
<if test="image != null and image != ''">#{image},
</if>
<if test="weekdayPrice != null">#{weekdayPrice},
</if>
<if test="weekendPrice != null">#{weekendPrice},
</if>
<if test="limitedLivePerson != null">#{limitedLivePerson},
</if>
<if test="cancelRuleType != null">#{cancelRuleType},
</if>
<if test="cancelRuleContent != null">#{cancelRuleContent},
</if>
<if test="area != null">#{area},
</if>
<if test="bedType != null">#{bedType},
</if>
<if test="window != null">#{window},
</if>
<if test="wifi != null">#{wifi},
</if>
<if test="floor != null">#{floor},
</if>
<if test="breakfast != null">#{breakfast},
</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},
</if>
<if test="deptId != null">#{deptId},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
<if test="submitTime != null">#{submitTime},
</if>
<if test="auditStatus != null">#{auditStatus},
</if>
<if test="auditTime != null">#{auditTime},
</if>
<if test="rejectReason != null and rejectReason !='' ">#{rejectReason},
</if>
<if test="grounding != null ">#{grounding},
</if>
<if test="flag != null ">#{flag},
</if>
<if test="sort != null ">#{sort},
</if>
</trim>
</insert>
<update id="updateZdyHotelHomestayRoomClassify" parameterType="ZdyHotelHomestayRoomClassify">
update zdy_hotel_homestay_room_classify
<trim prefix="SET" suffixOverrides=",">
<if test="hotelHomestayId != null">hotel_homestay_id =
#{hotelHomestayId},
</if>
<if test="level1Name != null and level1Name != ''">level1_name =
#{level1Name},
</if>
<if test="level2Name != null and level2Name != ''">level2_name =
#{level2Name},
</if>
<if test="image != null and image != ''">image =
#{image},
</if>
<if test="weekdayPrice != null">weekday_price =
#{weekdayPrice},
</if>
<if test="weekendPrice != null">weekend_price =
#{weekendPrice},
</if>
<if test="limitedLivePerson != null">limited_live_person =
#{limitedLivePerson},
</if>
<if test="cancelRuleType != null">cancel_rule_type =
#{cancelRuleType},
</if>
<if test="cancelRuleContent != null">cancel_rule_content =
#{cancelRuleContent},
</if>
<if test="area != null">area =
#{area},
</if>
<if test="bedType != null">bed_type =
#{bedType},
</if>
<if test="window != null">window =
#{window},
</if>
<if test="wifi != null">wifi =
#{wifi},
</if>
<if test="floor != null">floor =
#{floor},
</if>
<if test="delFlag != null and delFlag != ''">del_flag =
#{delFlag},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="submitTime != null">submit_time=
#{submitTime},
</if>
<if test="auditStatus != null">audit_status=
#{auditStatus},
</if>
<if test="auditTime != null">audit_time=
#{auditTime},
</if>
<if test="rejectReason != null and rejectReason !='' ">reject_reason=
#{rejectReason},
</if>
<if test="grounding != null ">grounding = #{grounding},
</if>
<if test="flag != null ">flag = #{flag},
</if>
<if test="sort != null ">sort = #{sort},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyHotelHomestayRoomClassifyById" parameterType="Long">
delete
from zdy_hotel_homestay_room_classify
where id = #{id}
</delete>
<delete id="deleteZdyHotelHomestayRoomClassifyByIds" parameterType="String">
update zdy_hotel_homestay_room_classify set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkLevel1NameAndLevel1NameUnique" resultMap="ZdyHotelHomestayRoomClassifyResult">
<include refid="selectZdyHotelHomestayRoomClassifyVo"/>
where
rc.hotel_homestay_id = #{hotelHomestayId}
and rc.level1_name = #{level1Name}
and rc.level2_name = #{level2Name}
and rc.del_flag = '0' limit 1
</select>
<select id="selectLevel1NameList" resultType="string">
select level1_name
from zdy_hotel_homestay_room_classify
where hotel_homestay_id = #{hotelHomestayId}
and del_flag = '0'
group by level1_name
</select>
<select id="selectRoomClassifyIds"
parameterType="com.zhwl.hotel.homestay.domain.dto.ZdyHotelHomestayRoomClassifyPriceQueryDTO"
resultType="long">
select id from zdy_hotel_homestay_room_classify rc
<where>
rc.del_flag = '0'
<if test="hotelHomestayRoomClassifyId != null">
and rc.id = #{hotelHomestayRoomClassifyId}
</if>
${params.dataScope}
</where>
</select>
<select id="countRoomClassifyIds"
parameterType="com.zhwl.hotel.homestay.domain.dto.ZdyHotelHomestayRoomClassifyPriceQueryDTO"
resultType="int">
select count(1) from zdy_hotel_homestay_room_classify rc
<where>
rc.del_flag = '0'
<if test="hotelHomestayRoomClassifyId != null">
and rc.id = #{hotelHomestayRoomClassifyId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectRoomPriceList"
parameterType="com.zhwl.hotel.homestay.domain.dto.ZdyHotelHomestayRoomClassifyPriceQueryDTO"
resultMap="ZdyHotelHomestayRoomPriceVOResult">
select rc.hotel_homestay_id,
rc.id hotel_homestay_room_classify_id,
rc.weekday_price,
rc.weekend_price,
rc.id room_classify_id,
b.record_date,
b.update_after_price as new_price,
rc.level1_name,
rc.level2_name
from zdy_hotel_homestay_room_classify rc
left join (select rpr.id,
rpr.dept_id,
rpr.hotel_homestay_id,
rpr.hotel_homestay_room_classify_id,
rpr.record_date,
rpr.update_after_price
from zdy_hotel_homestay_room_price_record rpr
inner join (select Max(id) max_id
from zdy_hotel_homestay_room_price_record
group by dept_id, hotel_homestay_id, hotel_homestay_room_classify_id,
record_date) a
on rpr.id = a.max_id) b on
rc.dept_id = b.dept_id
and rc.hotel_homestay_id = b.hotel_homestay_id
and rc.id = b.hotel_homestay_room_classify_id
<where>
<if test="hotelHomestayId != null">
and rc.hotel_homestay_id = #{hotelHomestayId}
</if>
<if test="roomClassifyIds != null and roomClassifyIds.size() > 0">
and rc.id in
<foreach collection="roomClassifyIds" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="startDate != null">
and date_format(b.record_date,'%y-%m-%d') &gt;=date_format(#{startDate},'%y-%m-%d')
</if>
<if test="endDate != null">
and date_format(b.record_date,'%y-%m-%d') &lt;=date_format(#{endDate},'%y-%m-%d')
</if>
</where>
</select>
<select id="selectFloor" resultType="string">
select floor
from zdy_hotel_homestay_room_classify rc
where rc.floor is not null
and rc.del_flag = '0'
${params.dataScope}
group by floor
</select>
<select id="appSelectCanBookRoomClassifyList"
parameterType="com.zhwl.hotel.homestay.domain.dto.AppRoomClassifyQueryDTO"
resultMap="ZdyHotelHomestayRoomClassifyVOResult">
select a.id, a.quantity
from (select r.hotel_homestay_room_classify_id id,
count(r.id) quantity,
MAX(rc.limited_live_person) limited_live_person
from zdy_hotel_homestay_room r
left join zdy_hotel_homestay_room_classify rc
on r.dept_id = rc.dept_id and r.hotel_homestay_id = rc.hotel_homestay_id
and r.hotel_homestay_room_classify_id = rc.id
<where>
r.id not in
(select distinct rs.room_id
from zdy_hotel_homestay_room_status rs
WHERE (
<![CDATA[
(
start_time <= CONCAT(DATE_FORMAT(#{startTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{checkInTime}
, '%H:%i:%s')
)
AND end_time >= CONCAT(DATE_FORMAT(#{endTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{leaveTime}
, '%H:%i:%s')))
or
(start_time >= CONCAT(DATE_FORMAT(#{startTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{checkInTime}
, '%H:%i:%s')
)
AND end_time <= CONCAT(DATE_FORMAT(#{endTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{leaveTime}
, '%H:%i:%s')))
or (
start_time <= CONCAT(DATE_FORMAT(#{startTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{checkInTime}
, '%H:%i:%s'))
AND end_time >= CONCAT(DATE_FORMAT(#{startTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{checkInTime}
, '%H:%i:%s')))
or
(start_time <= CONCAT(DATE_FORMAT(#{endTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{leaveTime}
, '%H:%i:%s'))
AND end_time >= CONCAT(DATE_FORMAT(#{endTime}
, '%Y-%m-%d')
, ' '
, TIME_FORMAT(#{leaveTime}
, '%H:%i:%s')))
)]]>)
<if test="hotelHomestayId != null">
and r.hotel_homestay_id = #{hotelHomestayId}
</if>
<if test="roomClassifyIds != null and roomClassifyIds.size() > 0">
and r.hotel_homestay_room_classify_id in
<foreach collection="roomClassifyIds" open="(" close=")" separator="," item="roomClassifyId">
#{roomClassifyId}
</foreach>
</if>
and r.del_flag = '0'
group by r.hotel_homestay_room_classify_id
</where>
) a
</select>
<select id="selectAllRoomClassifyList" parameterType="long" resultMap="ZdyHotelHomestayRoomClassifyResult">
select h.id hotel_homestay_id, rc.id, rc.weekday_price, rc.weekend_price
from zdy_hotel_homestay_room_classify rc
left join zdy_hotel_homestay h on rc.hotel_homestay_id = h.id
<where>
rc.del_flag = '0'
<if test="hotelHomestayIds != null and hotelHomestayIds.size() > 0">
and rc.hotel_homestay_id in
<foreach collection="hotelHomestayIds" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
<delete id="deleteByHotelHomestayIds" parameterType="long">
update zdy_hotel_homestay_room_classify set del_flag = '1' where hotel_homestay_id in
<foreach item="hotelHomestayId" collection="hotelHomestayIds" open="(" separator="," close=")">
#{hotelHomestayId}
</foreach>
</delete>
</mapper>