201 lines
7.1 KiB
XML
201 lines
7.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.eatery.mapper.ZdyEateryTableMapper">
|
|
|
|
<resultMap type="ZdyEateryTable" id="ZdyEateryTableResult">
|
|
<result property="id" column="id"/>
|
|
<result property="name" column="name"/>
|
|
<result property="area" column="area"/>
|
|
<result property="seats" column="seats"/>
|
|
<result property="dinersCount" column="diners_count"/>
|
|
<result property="enable" column="enable"/>
|
|
<result property="sort" column="sort"/>
|
|
<result property="status" column="status"/>
|
|
<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="merchantId" column="merchant_id"/>
|
|
<result property="orderId" column="order_id"/>
|
|
<result property="totalAmount" column="total_amount"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectZdyEateryTableVo">
|
|
select et.id, et.name, et.area, et.seats, et.enable, et.diners_count, et.sort, et.status, et.create_by,
|
|
et.create_time, et.update_by, et.update_time, et.remark, et.merchant_id, et.order_id, et.total_amount
|
|
from zdy_eatery_table et
|
|
left join sys_dept d on et.merchant_id = d.dept_id
|
|
</sql>
|
|
|
|
<select id="selectZdyEateryTableList" parameterType="ZdyEateryTable" resultMap="ZdyEateryTableResult">
|
|
<include refid="selectZdyEateryTableVo"/>
|
|
<where>
|
|
<if test="name != null and name != ''">
|
|
and name like concat('%', #{name}, '%')
|
|
</if>
|
|
<if test="area != null ">
|
|
and area = #{area}
|
|
</if>
|
|
<if test="enable != null and enable != ''">
|
|
and enable = #{enable}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
and status = #{status}
|
|
</if>
|
|
<if test="merchantId != null ">
|
|
and merchant_id = #{merchantId}
|
|
</if>
|
|
${params.dataScope}
|
|
</where>
|
|
order by sort
|
|
</select>
|
|
|
|
<select id="selectZdyEateryTableById" parameterType="Long"
|
|
resultMap="ZdyEateryTableResult">
|
|
<include refid="selectZdyEateryTableVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectTableCountByTableAreaId" resultType="java.lang.Integer" parameterType="java.lang.Long">
|
|
select count(1) from zdy_eatery_table where area = #{id}
|
|
<if test="merchantId != null">
|
|
and merchant_id = #{merchantId}
|
|
</if>
|
|
</select>
|
|
|
|
<insert id="insertZdyEateryTable" parameterType="ZdyEateryTable" useGeneratedKeys="true"
|
|
keyProperty="id">
|
|
insert into zdy_eatery_table
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="name != null">name,
|
|
</if>
|
|
<if test="area != null">area,
|
|
</if>
|
|
<if test="seats != null">seats,
|
|
</if>
|
|
<if test="enable != null">enable,
|
|
</if>
|
|
<if test="sort != null">sort,
|
|
</if>
|
|
<if test="status != null">status,
|
|
</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="merchantId != null">merchant_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="name != null">#{name},
|
|
</if>
|
|
<if test="area != null">#{area},
|
|
</if>
|
|
<if test="seats != null">#{seats},
|
|
</if>
|
|
<if test="enable != null">#{enable},
|
|
</if>
|
|
<if test="sort != null">#{sort},
|
|
</if>
|
|
<if test="status != null">#{status},
|
|
</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="merchantId != null">#{merchantId},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateZdyEateryTable" parameterType="ZdyEateryTable">
|
|
update zdy_eatery_table
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null">name =
|
|
#{name},
|
|
</if>
|
|
<if test="area != null">area =
|
|
#{area},
|
|
</if>
|
|
<if test="seats != null">seats =
|
|
#{seats},
|
|
</if>
|
|
<if test="dinersCount != null">diners_count =
|
|
#{dinersCount},
|
|
</if>
|
|
<if test="enable != null">enable =
|
|
#{enable},
|
|
</if>
|
|
<if test="sort != null">sort =
|
|
#{sort},
|
|
</if>
|
|
<if test="status != null">status =
|
|
#{status},
|
|
</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="orderId != null">order_id =
|
|
#{orderId},
|
|
</if>
|
|
<if test="totalAmount != null">total_amount =
|
|
#{totalAmount},
|
|
</if>
|
|
</trim>
|
|
where id = #{id}
|
|
<if test="merchantId != null">
|
|
and merchant_id = #{merchantId}
|
|
</if>
|
|
</update>
|
|
|
|
<delete id="deleteZdyEateryTableById" parameterType="Long">
|
|
delete from zdy_eatery_table where id = #{id}
|
|
<if test="merchantId != null">
|
|
and merchant_id = #{merchantId}
|
|
</if>
|
|
</delete>
|
|
|
|
<delete id="deleteZdyEateryTableByIds" parameterType="String">
|
|
delete from zdy_eatery_table where id in
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
<if test="merchantId != null">
|
|
and merchant_id = #{merchantId}
|
|
</if>
|
|
</delete>
|
|
|
|
<delete id="deleteByDeptIds" parameterType="long">
|
|
delete from zdy_eatery_table where merchant_id in
|
|
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
|
|
#{deptId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|