zhwl/zhwl-business/zhwl-ticket/target/classes/mapper/cinema/ZdyCinemaHallZoneMapper.xml
2025-07-01 17:54:58 +08:00

89 lines
3.1 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.cinema.mapper.ZdyCinemaHallZoneMapper">
<resultMap type="ZdyCinemaHallZone" id="ZdyCinemaHallZoneResult">
<result property="zoneId" column="zone_id"/>
<result property="hallId" column="hall_id"/>
<result property="zoneName" column="zone_name"/>
<result property="seatSet" column="seat_set"/>
</resultMap>
<sql id="selectZdyCinemaHallZoneVo">
select zone_id, hall_id, zone_name, seat_set
from zdy_cinema_hall_zone
</sql>
<select id="selectZdyCinemaHallZoneList" parameterType="ZdyCinemaHallZone" resultMap="ZdyCinemaHallZoneResult">
<include refid="selectZdyCinemaHallZoneVo"/>
<where>
<if test="hallId != null ">
and hall_id = #{hallId}
</if>
<if test="zoneName != null and zoneName != ''">
and zone_name like concat('%', #{zoneName}, '%')
</if>
<if test="seatSet != null ">
and seat_set = #{seatSet}
</if>
</where>
</select>
<select id="selectZdyCinemaHallZoneByZoneId" parameterType="Long"
resultMap="ZdyCinemaHallZoneResult">
<include refid="selectZdyCinemaHallZoneVo"/>
where zone_id = #{zoneId}
</select>
<insert id="insertZdyCinemaHallZone" parameterType="ZdyCinemaHallZone" useGeneratedKeys="true"
keyProperty="zoneId">
insert into zdy_cinema_hall_zone
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="hallId != null">hall_id,
</if>
<if test="zoneName != null">zone_name,
</if>
<if test="seatSet != null">seat_set,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="hallId != null">#{hallId},
</if>
<if test="zoneName != null">#{zoneName},
</if>
<if test="seatSet != null">#{seatSet},
</if>
</trim>
</insert>
<update id="updateZdyCinemaHallZone" parameterType="ZdyCinemaHallZone">
update zdy_cinema_hall_zone
<trim prefix="SET" suffixOverrides=",">
<if test="hallId != null">hall_id =
#{hallId},
</if>
<if test="zoneName != null">zone_name =
#{zoneName},
</if>
<if test="seatSet != null">seat_set =
#{seatSet},
</if>
</trim>
where zone_id = #{zoneId}
</update>
<delete id="deleteZdyCinemaHallZoneByZoneId" parameterType="Long">
delete
from zdy_cinema_hall_zone
where zone_id = #{zoneId}
</delete>
<delete id="deleteZdyCinemaHallZoneByZoneIds" parameterType="String">
delete from zdy_cinema_hall_zone where zone_id in
<foreach item="zoneId" collection="array" open="(" separator="," close=")">
#{zoneId}
</foreach>
</delete>
</mapper>