|
@@ -0,0 +1,101 @@
|
|
|
+<?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.huijy.management.mapper.ShopRoomOrderMapper">
|
|
|
+
|
|
|
+ <resultMap type="ShopRoomOrder" id="ShopRoomOrderResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="roomId" column="room_id"/>
|
|
|
+ <result property="memberId" column="member_id"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="phone" column="phone"/>
|
|
|
+ <result property="card" column="card"/>
|
|
|
+ <result property="min" column="min"/>
|
|
|
+ <result property="state" column="state"/>
|
|
|
+ <result property="max" column="max"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="days" column="days"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectShopRoomOrderVo">
|
|
|
+ select id, room_id, member_id, name, phone, card, day, state, create_time from tb_shop_room_order
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectShopRoomOrderList" parameterType="ShopRoomOrder" resultMap="ShopRoomOrderResult">
|
|
|
+ <include refid="selectShopRoomOrderVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="roomId != null ">and room_id = #{roomId}</if>
|
|
|
+ <if test="memberId != null ">and member_id = #{memberId}</if>
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectShopRoomOrderById" parameterType="Long" resultMap="ShopRoomOrderResult">
|
|
|
+ <include refid="selectShopRoomOrderVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectShopRoomOrderByUser" parameterType="Long" resultMap="ShopRoomOrderResult">
|
|
|
+ SELECT o.*,r.title,r.pic,r.price,s.name FROM tb_shop_room_order o
|
|
|
+ LEFT JOIN tb_shop_room r ON r.id=o.room_id
|
|
|
+ LEFT JOIN t_shop s ON s.shop_id=r.shop_id
|
|
|
+ WHERE s.member_id=2
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertShopRoomOrder" parameterType="ShopRoomOrder" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into tb_shop_room_order
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="roomId != null">room_id,</if>
|
|
|
+ <if test="memberId != null">member_id,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="card != null">card,</if>
|
|
|
+ <if test="min != null">min,</if>
|
|
|
+ <if test="state != null">state,</if>
|
|
|
+ <if test="max != null">max,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="days != null">days,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="roomId != null">#{roomId},</if>
|
|
|
+ <if test="memberId != null">#{memberId},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="card != null">#{card},</if>
|
|
|
+ <if test="min != null">#{min},</if>
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
+ <if test="max != null">#{max},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="days != null">#{days},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateShopRoomOrder" parameterType="ShopRoomOrder">
|
|
|
+ update tb_shop_room_order
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="roomId != null">room_id = #{roomId},</if>
|
|
|
+ <if test="memberId != null">member_id = #{memberId},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="card != null">card = #{card},</if>
|
|
|
+ <if test="min != null">min = #{min},</if>
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
+ <if test="max != null">max = #{max},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="days != null">days = #{days},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteShopRoomOrderById" parameterType="Long">
|
|
|
+ delete from tb_shop_room_order where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteShopRoomOrderByIds" parameterType="String">
|
|
|
+ delete from tb_shop_room_order where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|