This commit is contained in:
2025-07-01 17:54:58 +08:00
commit 57dcd609e2
5136 changed files with 346184 additions and 0 deletions

View File

@@ -0,0 +1,235 @@
<?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.ZdyEateryDishesAttributeMapper">
<resultMap type="ZdyEateryDishesAttribute" id="ZdyEateryDishesAttributeResult">
<result property="id" column="id"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
<result property="priceMarkup" column="price_markup"/>
<result property="enable" column="enable"/>
<result property="sort" column="sort"/>
<result property="applicationScope" column="application_scope"/>
<result property="applicationScopeId" column="application_scope_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="merchantId" column="merchant_id"/>
</resultMap>
<sql id="selectZdyEateryDishesAttributeVo">
select epa.id, epa.type, epa.name, epa.price_markup, epa.enable, epa.sort, epa.application_scope,
epa.application_scope_id, epa.create_by, epa.create_time, epa.update_by, epa.update_time, epa.remark, epa.merchant_id
from zdy_eatery_product_attribute epa
left join sys_dept d on epa.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryDishesAttributeList" parameterType="ZdyEateryDishesAttribute"
resultMap="ZdyEateryDishesAttributeResult">
<include refid="selectZdyEateryDishesAttributeVo"/>
<where>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="enable != null and enable != ''">
and enable = #{enable}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and epa.create_time between #{params.beginTime} and #{params.endTime}
</if>
<if test="applicationScope != null ">
and application_scope = #{applicationScope}
</if>
<if test="applicationScopeId != null ">
and find_in_set(#{applicationScopeId},application_scope_id)
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
${params.dataScope}
</where>
order by sort
</select>
<select id="selectZdyEateryDishesAttributeListByProductId" resultMap="ZdyEateryDishesAttributeResult"
parameterType="java.lang.Long">
<include refid="selectZdyEateryDishesAttributeVo"/>
<where>
and ( FIND_IN_SET(#{id}, application_scope_id) OR application_scope = 'all' OR FIND_IN_SET((SELECT type FROM
zdy_eatery_product WHERE id = #{id}), application_scope_id) )
</where>
</select>
<select id="selectZdyEateryDishesAttributeById" parameterType="Long"
resultMap="ZdyEateryDishesAttributeResult">
<include refid="selectZdyEateryDishesAttributeVo"/>
where id = #{id}
</select>
<select id="listCanAll" resultMap="ZdyEateryDishesAttributeResult" parameterType="ZdyEateryDishesAttribute" >
<include refid="selectZdyEateryDishesAttributeVo"/>
<where>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="enable != null and enable != ''">
and enable = #{enable}
</if>
${params.dataScope}
</where>
order by sort
</select>
<select id="selectZdyEateryDishesAttributeListAdded" resultMap="ZdyEateryDishesAttributeResult" parameterType="ZdyEateryDishesAttribute" >
<include refid="selectZdyEateryDishesAttributeVo"/>
<where>
and ( FIND_IN_SET(#{id}, application_scope_id) OR application_scope = 'all' OR FIND_IN_SET((SELECT type FROM
zdy_eatery_product WHERE id = #{id}), application_scope_id))
${params.dataScope}
</where>
order by sort
</select>
<insert id="insertZdyEateryDishesAttribute" parameterType="ZdyEateryDishesAttribute" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_product_attribute
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,
</if>
<if test="name != null">name,
</if>
<if test="priceMarkup != null">price_markup,
</if>
<if test="enable != null">enable,
</if>
<if test="applicationScope != null">application_scope,
</if>
<if test="applicationScopeId != null">application_scope_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="merchantId != null">merchant_id,
</if>
<if test="sort != null">sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},
</if>
<if test="name != null">#{name},
</if>
<if test="priceMarkup != null">#{priceMarkup},
</if>
<if test="enable != null">#{enable},
</if>
<if test="applicationScope != null">#{applicationScope},
</if>
<if test="applicationScopeId != null">#{applicationScopeId},
</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>
<if test="sort != null">#{sort},
</if>
</trim>
</insert>
<update id="updateZdyEateryDishesAttribute" parameterType="ZdyEateryDishesAttribute">
update zdy_eatery_product_attribute
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type =
#{type},
</if>
<if test="name != null">name =
#{name},
</if>
<if test="priceMarkup != null">price_markup =
#{priceMarkup},
</if>
<if test="enable != null">enable =
#{enable},
</if>
<if test="applicationScope != null">application_scope =
#{applicationScope},
</if>
<if test="applicationScopeId != null">application_scope_id =
#{applicationScopeId},
</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="sort != null">sort =
#{sort},
</if>
</trim>
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<delete id="deleteZdyEateryDishesAttributeById" parameterType="Long">
delete from zdy_eatery_product_attribute where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</delete>
<delete id="deleteZdyEateryDishesAttributeByIds" parameterType="String">
delete from zdy_eatery_product_attribute where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyEateryDishesAttributeListByRelationProductId" resultMap="ZdyEateryDishesAttributeResult">
select *
from zdy_eatery_product_attribute epa
inner join zdy_eatery_product_attribute_relation epar on epa.id = epar.product_attribute_id
where epar.product_id = #{productId}
</select>
<delete id="deleteByDeptIds" parameterType="long">
delete from zdy_eatery_product_attribute where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,243 @@
<?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.ZdyEateryDishesTypeMapper">
<resultMap type="ZdyEateryDishesType" id="ZdyEateryDishesTypeResult">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="productType" column="product_type"/>
<result property="name" column="name"/>
<result property="code" column="code"/>
<result property="img" column="img"/>
<result property="enableApp" column="enable_app"/>
<result property="enableFrontend" column="enable_frontend"/>
<result property="sort" column="sort"/>
<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"/>
</resultMap>
<sql id="selectZdyEateryDishesTypeVo">
select apt.id, apt.parent_id, apt.product_type, apt.name, apt.code, apt.img, apt.enable_app, apt.enable_frontend,
apt.sort, apt.create_by, apt.create_time, apt.update_by, apt.update_time, apt.remark, apt.merchant_id
from zdy_eatery_product_type apt
left join sys_dept d on apt.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryDishesTypeList" parameterType="ZdyEateryDishesType"
resultMap="ZdyEateryDishesTypeResult">
<include refid="selectZdyEateryDishesTypeVo"/>
<where>
<if test="parentId != null ">
and parent_id = #{parentId}
</if>
<if test="productType != null and productType != ''">
and product_type = #{productType}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
<if test="enableFrontend != null ">
and enable_frontend = #{enableFrontend}
</if>
<if test="enableApp != null ">
and enable_app = #{enableApp}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and apt.create_time between #{params.beginTime} and #{params.endTime}
</if>
${params.dataScope}
</where>
order by sort
</select>
<select id="selectZdyEateryDishesTypeById" parameterType="Long"
resultMap="ZdyEateryDishesTypeResult">
<include refid="selectZdyEateryDishesTypeVo"/>
where id = #{id}
</select>
<select id="selectZdyEateryDishesTypeByName" resultType="java.lang.Long">
SELECT id FROM zdy_eatery_product_type
where name = #{name}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</select>
<select id="selectZdyEateryDishesTypeListWithoutLogin" parameterType="ZdyEateryDishesType"
resultMap="ZdyEateryDishesTypeResult">
<include refid="selectZdyEateryDishesTypeVo"/>
<where>
<if test="parentId != null ">
and parent_id = #{parentId}
</if>
<if test="productType != null and productType != ''">
and product_type = #{productType}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
<if test="enableFrontend != null ">
and enable_frontend = #{enableFrontend}
</if>
<if test="enableApp != null ">
and enable_app = #{enableApp}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and create_time between #{params.beginTime} and #{params.endTime}
</if>
</where>
order by sort
</select>
<insert id="insertZdyEateryDishesType" parameterType="ZdyEateryDishesType">
insert into zdy_eatery_product_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="parentId != null">parent_id,
</if>
<if test="productType != null">product_type,
</if>
<if test="name != null">name,
</if>
<if test="code != null">code,
</if>
<if test="img != null">img,
</if>
<if test="enableApp != null">enable_app,
</if>
<if test="enableFrontend != null">enable_frontend,
</if>
<if test="sort != null">sort,
</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="id != null">#{id},
</if>
<if test="parentId != null">#{parentId},
</if>
<if test="productType != null">#{productType},
</if>
<if test="name != null">#{name},
</if>
<if test="code != null">#{code},
</if>
<if test="img != null">#{img},
</if>
<if test="enableApp != null">#{enableApp},
</if>
<if test="enableFrontend != null">#{enableFrontend},
</if>
<if test="sort != null">#{sort},
</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="updateZdyEateryDishesType" parameterType="ZdyEateryDishesType">
update zdy_eatery_product_type
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id =
#{parentId},
</if>
<if test="productType != null">product_type =
#{productType},
</if>
<if test="name != null">name =
#{name},
</if>
<if test="code != null">code =
#{code},
</if>
<if test="img != null">img =
#{img},
</if>
<if test="enableApp != null">enable_app =
#{enableApp},
</if>
<if test="enableFrontend != null">enable_frontend =
#{enableFrontend},
</if>
<if test="sort != null">sort =
#{sort},
</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>
</trim>
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<delete id="deleteZdyEateryDishesTypeById" parameterType="Long">
delete from zdy_eatery_product_type where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</delete>
<delete id="deleteZdyEateryDishesTypeByIds" parameterType="String">
delete from zdy_eatery_product_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteByDeptIds" parameterType="long">
delete from zdy_eatery_product_type where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,350 @@
<?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.ZdyEateryOrderMapper">
<resultMap type="ZdyEateryOrder" id="ZdyEateryOrderResult">
<result property="id" column="id"/>
<result property="customerId" column="customer_id"/>
<result property="customerName" column="customer_name"/>
<result property="tableId" column="table_id"/>
<result property="orderDate" column="order_date"/>
<result property="orderType" column="order_type"/>
<result property="orderStatus" column="order_status"/>
<result property="totalAmount" column="total_amount"/>
<result property="receivable" column="receivable"/>
<result property="discountAmount" column="discount_amount"/>
<result property="actualReceivedAmount" column="actual_received_amount"/>
<result property="changeAmount" column="change_amount"/>
<result property="zeroAmount" column="zero_amount"/>
<result property="paymentMethod" column="payment_method"/>
<result property="paymentStatus" column="payment_status"/>
<result property="productTotalCount" column="product_total_count"/>
<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="shopName" column="shop_name"/>
<result property="shopAddress" column="shop_address"/>
<result property="shopPhone" column="shop_phone"/>
<result property="dinersCount" column="diners_count"/>
</resultMap>
<sql id="selectZdyEateryOrderVo">
select eo.id, eo.customer_id, eo.customer_name, eo.table_id, eo.order_date, eo.order_type, eo.order_status,
eo.total_amount, eo.receivable, eo.discount_amount, eo.actual_received_amount, eo.change_amount, eo.zero_amount,
eo.payment_method, eo.payment_status, eo.product_total_count, eo.create_by, eo.create_time, eo.update_by,
eo.update_time, eo.remark, eo.merchant_id, eo.shop_name, eo.shop_address, eo.shop_phone, eo.diners_count
from zdy_eatery_order eo
left join sys_dept d on eo.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryOrderList" parameterType="ZdyEateryOrder" resultMap="ZdyEateryOrderResult">
<include refid="selectZdyEateryOrderVo"/>
<where>
<if test="id != null ">
and id = #{id}
</if>
<if test="customerId != null ">
and customer_id = #{customerId}
</if>
<if test="customerName != null and customerName != ''">
and customer_name like concat('%', #{customerName}, '%')
</if>
<if test="tableId != null ">
and table_id = #{tableId}
</if>
<if test="orderDate != null ">
and order_date = #{orderDate}
</if>
<if test="orderType != null and orderType != ''">
and order_type = #{orderType}
</if>
<if test="orderStatus != null and orderStatus != ''">
and order_status = #{orderStatus}
</if>
<if test="totalAmount != null ">
and total_amount = #{totalAmount}
</if>
<if test="discountAmount != null ">
and discount_amount = #{discountAmount}
</if>
<if test="actualReceivedAmount != null ">
and actual_received_amount = #{actualReceivedAmount}
</if>
<if test="changeAmount != null ">
and change_amount = #{changeAmount}
</if>
<if test="zeroAmount != null ">
and zero_amount = #{zeroAmount}
</if>
<if test="paymentMethod != null and paymentMethod != ''">
and payment_method = #{paymentMethod}
</if>
<if test="paymentStatus != null and paymentStatus != ''">
and payment_status = #{paymentStatus}
</if>
<if test="productTotalCount != null ">
and product_total_count = #{productTotalCount}
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and order_date between #{params.beginTime} and #{params.endTime}
</if>
${params.dataScope}
</where>
order by order_date desc
</select>
<select id="selectZdyEateryOrderById" parameterType="String"
resultMap="ZdyEateryOrderResult">
<include refid="selectZdyEateryOrderVo"/>
where id = #{id}
</select>
<select id="statistics" resultType="com.alibaba.fastjson2.JSONObject">
SELECT
IFNULL(SUM(CASE WHEN a.order_status = 'completed' or a.order_status = 'allReturn' or a.order_status = 'partialReturn'
THEN 1 ELSE 0 END),0) AS sumOrder,
IFNULL(SUM(CASE WHEN a.order_status = 'completed' or a.order_status = 'refund' or a.order_status = 'allReturn' or
a.order_status = 'partialReturn' THEN a.receivable ELSE 0 END),0) AS turnover,
IFNULL(SUM(CASE WHEN a.order_status = 'allReturn' or a.order_status = 'partialReturn' THEN 1 ELSE 0 END),0) AS
sumRefundOrder,
IFNULL(SUM(CASE WHEN a.order_type = '2' THEN 1 ELSE 0 END),0) AS sumRefund
from (SELECT eo.*
FROM zdy_eatery_order eo
left join sys_dept d on eo.merchant_id = d.dept_id
<where>
<if test="id != null ">
and id = #{id}
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and order_date between #{params.beginTime} and #{params.endTime}
</if>
${params.dataScope}
</where>
) a
</select>
<insert id="insertZdyEateryOrder" parameterType="ZdyEateryOrder" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="refundId != null">refund_id,
</if>
<if test="customerId != null">customer_id,
</if>
<if test="customerName != null">customer_name,
</if>
<if test="tableId != null">table_id,
</if>
<if test="orderDate != null">order_date,
</if>
<if test="orderType != null">order_type,
</if>
<if test="orderStatus != null">order_status,
</if>
<if test="totalAmount != null">total_amount,
</if>
<if test="discountAmount != null">discount_amount,
</if>
<if test="actualReceivedAmount != null">actual_received_amount,
</if>
<if test="changeAmount != null">change_amount,
</if>
<if test="zeroAmount != null">zero_amount,
</if>
<if test="paymentMethod != null">payment_method,
</if>
<if test="paymentStatus != null">payment_status,
</if>
<if test="productTotalCount != null">product_total_count,
</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>
<if test="shopName != null">shop_name,
</if>
<if test="shopAddress != null">shop_address,
</if>
<if test="shopPhone != null">shop_phone,
</if>
<if test="dinersCount != null">diners_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},
</if>
<if test="refundId != null">#{refundId},
</if>
<if test="customerId != null">#{customerId},
</if>
<if test="customerName != null">#{customerName},
</if>
<if test="tableId != null">#{tableId},
</if>
<if test="orderDate != null">#{orderDate},
</if>
<if test="orderType != null">#{orderType},
</if>
<if test="orderStatus != null">#{orderStatus},
</if>
<if test="totalAmount != null">#{totalAmount},
</if>
<if test="discountAmount != null">#{discountAmount},
</if>
<if test="actualReceivedAmount != null">#{actualReceivedAmount},
</if>
<if test="changeAmount != null">#{changeAmount},
</if>
<if test="zeroAmount != null">#{zeroAmount},
</if>
<if test="paymentMethod != null">#{paymentMethod},
</if>
<if test="paymentStatus != null">#{paymentStatus},
</if>
<if test="productTotalCount != null">#{productTotalCount},
</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>
<if test="shopName != null">#{shopName},
</if>
<if test="shopAddress != null">#{shopAddress},
</if>
<if test="shopPhone != null">#{shopPhone},
</if>
<if test="dinersCount != null">#{dinersCount},
</if>
</trim>
</insert>
<update id="updateZdyEateryOrder" parameterType="ZdyEateryOrder">
update zdy_eatery_order
<trim prefix="SET" suffixOverrides=",">
<if test="customerId != null">customer_id =
#{customerId},
</if>
<if test="customerName != null">customer_name =
#{customerName},
</if>
<if test="tableId != null">table_id =
#{tableId},
</if>
<if test="orderDate != null">order_date =
#{orderDate},
</if>
<if test="orderType != null">order_type =
#{orderType},
</if>
<if test="orderStatus != null">order_status =
#{orderStatus},
</if>
<if test="totalAmount != null">total_amount =
#{totalAmount},
</if>
<if test="receivable != null">receivable =
#{receivable},
</if>
<if test="discountAmount != null">discount_amount =
#{discountAmount},
</if>
<if test="actualReceivedAmount != null">actual_received_amount =
#{actualReceivedAmount},
</if>
<if test="changeAmount != null">change_amount =
#{changeAmount},
</if>
<if test="zeroAmount != null">zero_amount =
#{zeroAmount},
</if>
<if test="paymentMethod != null">payment_method =
#{paymentMethod},
</if>
<if test="paymentStatus != null">payment_status =
#{paymentStatus},
</if>
<if test="productTotalCount != null">product_total_count =
#{productTotalCount},
</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="shopName != null">shop_name =
#{shopName},
</if>
<if test="shopAddress != null">shop_address =
#{shopAddress},
</if>
<if test="shopPhone != null">shop_phone =
#{shopPhone},
</if>
<if test="dinersCount != null">diners_count =
#{dinersCount},
</if>
</trim>
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<delete id="deleteZdyEateryOrderById" parameterType="String">
delete from zdy_eatery_order where id = #{id}
</delete>
<delete id="deleteZdyEateryOrderByIds" parameterType="String">
delete from zdy_eatery_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countByDeptIds" parameterType="long" resultType="int">
select count(id) from zdy_eatery_order where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId}
</foreach>
</select>
</mapper>

View File

@@ -0,0 +1,366 @@
<?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.ZdyEateryOrderProductMapper">
<resultMap type="ZdyEateryOrderProduct" id="ZdyEateryOrderProductResult">
<result property="id" column="id"/>
<result property="refundId" column="refund_id"/>
<result property="orderId" column="order_id"/>
<result property="productId" column="product_id"/>
<result property="productName" column="product_name"/>
<result property="productImg" column="product_img"/>
<result property="productSpecsId" column="product_specs_id"/>
<result property="productSpecsName" column="product_specs_name"/>
<result property="productSpecsPrice" column="product_specs_price"/>
<result property="unit" column="unit"/>
<result property="productExtraId" column="product_extra_id"/>
<result property="productExtraName" column="product_extra_name"/>
<result property="productExtraPrice" column="product_extra_price"/>
<result property="productTasteId" column="product_taste_id"/>
<result property="productTasteName" column="product_taste_name"/>
<result property="productTastePrice" column="product_taste_price"/>
<result property="quantity" column="quantity"/>
<result property="returnableQuantity" column="returnable_quantity"/>
<result property="unitPrice" column="unit_price"/>
<result property="totalPrice" column="total_price"/>
<result property="finallyUnitPrice" column="finally_unit_price"/>
<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"/>
</resultMap>
<sql id="selectZdyEateryOrderProductVo">
select eop.id, eop.refund_id, eop.order_id, eop.product_id, eop.product_name, eop.product_img, eop.product_specs_id,
eop.product_specs_name, eop.product_specs_price, eop.product_extra_id, eop.product_extra_name, eop.product_extra_price,
eop.product_taste_id, eop.product_taste_name, eop.product_taste_price, eop.quantity, eop.returnable_quantity,
eop.unit_price, eop.total_price, eop.finally_unit_price, eop.create_by, eop.create_time, eop.update_by, eop.unit,
eop.update_time, eop.remark, eop.merchant_id
from zdy_eatery_order_product eop
left join sys_dept d on eop.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryOrderProductList" parameterType="ZdyEateryOrderProduct"
resultMap="ZdyEateryOrderProductResult">
<include refid="selectZdyEateryOrderProductVo"/>
<where>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="productId != null ">
and product_id = #{productId}
</if>
<if test="productName != null and productName != ''">
and product_name like concat('%', #{productName}, '%')
</if>
<if test="productImg != null and productImg != ''">
and product_img = #{productImg}
</if>
<if test="productSpecsId != null ">
and product_specs_id = #{productSpecsId}
</if>
<if test="productSpecsName != null and productSpecsName != ''">
and product_specs_name like concat('%', #{productSpecsName}, '%')
</if>
<if test="productSpecsPrice != null ">
and product_specs_price = #{productSpecsPrice}
</if>
<if test="productExtraId != null ">
and product_extra_id = #{productExtraId}
</if>
<if test="productExtraName != null and productExtraName != ''">
and product_extra_name like concat('%', #{productExtraName}, '%')
</if>
<if test="productExtraPrice != null ">
and product_extra_price = #{productExtraPrice}
</if>
<if test="productTasteId != null ">
and product_taste_id = #{productTasteId}
</if>
<if test="productTasteName != null and productTasteName != ''">
and product_taste_name like concat('%', #{productTasteName}, '%')
</if>
<if test="productTastePrice != null ">
and product_taste_price = #{productTastePrice}
</if>
<if test="quantity != null ">
and quantity = #{quantity}
</if>
<if test="unitPrice != null ">
and unit_price = #{unitPrice}
</if>
<if test="totalPrice != null ">
and total_price = #{totalPrice}
</if>
<if test="finallyUnitPrice != null ">
and finally_unit_price = #{finallyUnitPrice}
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyEateryOrderProductById" parameterType="Long"
resultMap="ZdyEateryOrderProductResult">
<include refid="selectZdyEateryOrderProductVo"/>
where id = #{id}
</select>
<select id="selectZdyEateryOrderProductListWithoutReturn" parameterType="ZdyEateryOrderProduct"
resultMap="ZdyEateryOrderProductResult">
SELECT
a.id,
a.order_id,
a. product_id,
a. product_name,
a. product_img,
a. product_specs_id,
a. product_specs_name,
a. product_specs_price,
a. product_extra_id,
a. product_extra_name,
a. product_extra_price,
a. product_taste_id,
a. product_taste_name,
a. product_taste_price,
a. quantity,
a. returnable_quantity,
a. unit_price,
a. total_price,
a. finally_unit_price,
a.create_by,
a.create_time,
a.update_by,
a. unit,
a.update_time,
a.remark,
a.merchant_id
FROM
zdy_eatery_order_product a
LEFT JOIN
zdy_eatery_order_product b ON a.id = b.refund_id
AND b.order_id = #{orderId}
LEFT JOIN
zdy_eatery_order c ON a.order_id = c.id
WHERE
a.order_id = #{orderId}
AND (order_type = 2
OR a.quantity > 0
AND (a.quantity + b.quantity > 0
OR b.quantity IS NULL))
</select>
<insert id="insertZdyEateryOrderProduct" parameterType="ZdyEateryOrderProduct" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_order_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundId != null">refund_id,
</if>
<if test="orderId != null">order_id,
</if>
<if test="productId != null">product_id,
</if>
<if test="productName != null">product_name,
</if>
<if test="productImg != null">product_img,
</if>
<if test="productSpecsId != null">product_specs_id,
</if>
<if test="productSpecsName != null">product_specs_name,
</if>
<if test="productSpecsPrice != null">product_specs_price,
</if>
<if test="unit != null">unit,
</if>
<if test="productExtraId != null">product_extra_id,
</if>
<if test="productExtraName != null">product_extra_name,
</if>
<if test="productExtraPrice != null">product_extra_price,
</if>
<if test="productTasteId != null">product_taste_id,
</if>
<if test="productTasteName != null">product_taste_name,
</if>
<if test="productTastePrice != null">product_taste_price,
</if>
<if test="quantity != null">quantity,
</if>
<if test="returnableQuantity != null">returnable_quantity,
</if>
<if test="unitPrice != null">unit_price,
</if>
<if test="totalPrice != null">total_price,
</if>
<if test="finallyUnitPrice != null">finally_unit_price,
</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="refundId != null">#{refundId},
</if>
<if test="orderId != null">#{orderId},
</if>
<if test="productId != null">#{productId},
</if>
<if test="productName != null">#{productName},
</if>
<if test="productImg != null">#{productImg},
</if>
<if test="productSpecsId != null">#{productSpecsId},
</if>
<if test="productSpecsName != null">#{productSpecsName},
</if>
<if test="productSpecsPrice != null">#{productSpecsPrice},
</if>
<if test="unit != null">#{unit},
</if>
<if test="productExtraId != null">#{productExtraId},
</if>
<if test="productExtraName != null">#{productExtraName},
</if>
<if test="productExtraPrice != null">#{productExtraPrice},
</if>
<if test="productTasteId != null">#{productTasteId},
</if>
<if test="productTasteName != null">#{productTasteName},
</if>
<if test="productTastePrice != null">#{productTastePrice},
</if>
<if test="quantity != null">#{quantity},
</if>
<if test="returnableQuantity != null">#{returnableQuantity},
</if>
<if test="unitPrice != null">#{unitPrice},
</if>
<if test="totalPrice != null">#{totalPrice},
</if>
<if test="finallyUnitPrice != null">#{finallyUnitPrice},
</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="updateZdyEateryOrderProduct" parameterType="ZdyEateryOrderProduct">
update zdy_eatery_order_product
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id =
#{orderId},
</if>
<if test="productId != null">product_id =
#{productId},
</if>
<if test="productName != null">product_name =
#{productName},
</if>
<if test="productImg != null">product_img =
#{productImg},
</if>
<if test="productSpecsId != null">product_specs_id =
#{productSpecsId},
</if>
<if test="productSpecsName != null">product_specs_name =
#{productSpecsName},
</if>
<if test="unit != null">unit =
#{unit},
</if>
<if test="productSpecsPrice != null">product_specs_price =
#{productSpecsPrice},
</if>
<if test="productExtraId != null">product_extra_id =
#{productExtraId},
</if>
<if test="productExtraName != null">product_extra_name =
#{productExtraName},
</if>
<if test="productExtraPrice != null">product_extra_price =
#{productExtraPrice},
</if>
<if test="productTasteId != null">product_taste_id =
#{productTasteId},
</if>
<if test="productTasteName != null">product_taste_name =
#{productTasteName},
</if>
<if test="productTastePrice != null">product_taste_price =
#{productTastePrice},
</if>
<if test="quantity != null">quantity =
#{quantity},
</if>
<if test="returnableQuantity != null">returnable_quantity =
#{returnableQuantity},
</if>
<if test="finallyBuyQuantity != null">finally_buy_quantity =
#{finallyBuyQuantity},
</if>
<if test="unitPrice != null">unit_price =
#{unitPrice},
</if>
<if test="totalPrice != null">total_price =
#{totalPrice},
</if>
<if test="finallyUnitPrice != null">finally_unit_price =
#{finallyUnitPrice},
</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="merchantId != null">merchant_id =
#{merchantId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyEateryOrderProductById" parameterType="Long">
delete from zdy_eatery_order_product where id = #{id}
</delete>
<delete id="deleteZdyEateryOrderProductByIds" parameterType="String">
delete from zdy_eatery_order_product where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,86 @@
<?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.ZdyEateryProductAttributeRelationMapper">
<resultMap type="ZdyEateryProductAttributeRelation" id="ZdyEateryProductAttributeRelationResult">
<result property="productId" column="product_id"/>
<result property="productAttributeId" column="product_attribute_id"/>
</resultMap>
<sql id="selectZdyEateryProductAttributeRelationVo">
select product_id, product_attribute_id
from zdy_eatery_product_attribute_relation
</sql>
<select id="selectZdyEateryProductAttributeRelationList" parameterType="ZdyEateryProductAttributeRelation"
resultMap="ZdyEateryProductAttributeRelationResult">
<include refid="selectZdyEateryProductAttributeRelationVo"/>
<where>
<if test="productId != null ">
and product_id = #{productId}
</if>
<if test="productAttributeId != null ">
and product_attribute_id = #{productAttributeId}
</if>
</where>
</select>
<select id="selectZdyEateryProductAttributeRelationByProductId" parameterType="long"
resultMap="ZdyEateryProductAttributeRelationResult">
<include refid="selectZdyEateryProductAttributeRelationVo"/>
where product_id = #{productId}
</select>
<select id="selectByProductAttributeId" parameterType="long"
resultMap="ZdyEateryProductAttributeRelationResult">
<include refid="selectZdyEateryProductAttributeRelationVo"/>
where product_attribute_id = #{productAttributeId}
</select>
<insert id="insertZdyEateryProductAttributeRelation" parameterType="ZdyEateryProductAttributeRelation">
insert into zdy_eatery_product_attribute_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productId != null">product_id,
</if>
<if test="productAttributeId != null">product_attribute_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">#{productId},
</if>
<if test="productAttributeId != null">#{productAttributeId},
</if>
</trim>
</insert>
<update id="updateZdyEateryProductAttributeRelation" parameterType="ZdyEateryProductAttributeRelation">
update zdy_eatery_product_attribute_relation
<trim prefix="SET" suffixOverrides=",">
<if test="productAttributeId != null">product_attribute_id =
#{productAttributeId},
</if>
</trim>
where product_id = #{productId}
</update>
<delete id="deleteZdyEateryProductAttributeRelationByProductId" parameterType="long">
delete
from zdy_eatery_product_attribute_relation
where product_id = #{productId}
</delete>
<delete id="deleteZdyEateryProductAttributeRelationByProductIds" parameterType="String">
delete from zdy_eatery_product_attribute_relation where product_id in
<foreach item="productId" collection="array" open="(" separator="," close=")">
#{productId}
</foreach>
</delete>
<delete id="deleteZdyEateryProductAttributeRelationByProductAttributeId" parameterType="long">
delete
from zdy_eatery_product_attribute_relation
where product_attribute_id = #{productAttributeId}
</delete>
</mapper>

View File

@@ -0,0 +1,492 @@
<?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.ZdyEateryProductMapper">
<resultMap type="ZdyEateryProductVo" id="ZdyEateryProductResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="img" column="img"/>
<result property="salePrise" column="sale_prise"/>
<result property="code" column="code"/>
<result property="manufactureDate" column="manufacture_date"/>
<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="submitTime" column="submit_time"/>
<result property="auditStatus" column="audit_status"/>
<result property="auditTime" column="audit_time"/>
<result property="rejectReason" column="reject_reason"/>
<result property="flag" column="flag"/>
<result property="shopName" column="shop_name"/>
</resultMap>
<resultMap id="ZdyEateryProductZdyEateryProductSpecsResult" type="ZdyEateryProduct"
extends="ZdyEateryProductResult">
<collection property="zdyEateryProductSpecsList" notNullColumn="sub_id"
javaType="java.util.List" resultMap="ZdyEateryProductSpecsResult"/>
</resultMap>
<resultMap type="ZdyEateryProductSpecs" id="ZdyEateryProductSpecsResult">
<result property="id" column="sub_id"/>
<result property="productId" column="sub_product_id"/>
<result property="name" column="sub_name"/>
<result property="price" column="sub_price"/>
<result property="createBy" column="sub_create_by"/>
<result property="createTime" column="sub_create_time"/>
<result property="updateBy" column="sub_update_by"/>
<result property="updateTime" column="sub_update_time"/>
<result property="remark" column="sub_remark"/>
<result property="merchantId" column="sub_merchant_id"/>
</resultMap>
<sql id="selectZdyEateryProductVo">
select ep.id,
ep.name,
ep.type,
ep.img,
ep.sale_prise,
ep.code,
ep.sort,
ep.status,
ep.manufacture_date,
ep.create_by,
ep.create_time,
ep.update_by,
ep.update_time,
ep.remark,
ep.merchant_id,
ep.submit_time,
ep.audit_status,
ep.audit_time,
ep.reject_reason,
ep.flag,
ep.sort
from zdy_eatery_product ep
left join sys_dept d on ep.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryProductList" parameterType="ZdyEateryProduct" resultMap="ZdyEateryProductResult">
select ep.id, ep.name, ep.type, ep.img, ep.sale_prise, ep.code, ep.sort, ep.status, ep.manufacture_date,
ep.create_by, ep.create_time, ep.update_by, ep.update_time, ep.remark, ep.merchant_id,
ep.submit_time,
ep.audit_status,
ep.audit_time,
ep.reject_reason,
ep.flag,
ep.sort,
sbi.name shop_name
from zdy_eatery_product ep
left join sys_dept d on ep.merchant_id = d.dept_id
left join zdy_store_base_info sbi on sbi.dept_id=d.dept_id
<where>
and ep.delete_flag = 0
<if test="name != null and name != ''">
and ep.name like concat('%', #{name}, '%')
</if>
<if test="type != null and type != ''">
and ep.type = #{type}
</if>
<if test="img != null and img != ''">
and ep.img = #{img}
</if>
<if test="code != null and code != ''">
and ep.code = #{code}
</if>
<if test="status != null and status != ''">
and FIND_IN_SET(ep.status, #{status}) > 0
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and ep.manufacture_date between #{params.beginTime} and #{params.endTime}
</if>
<if test="params.beginManufactureDate != null and params.beginManufactureDate != '' and params.endManufactureDate != null and params.endManufactureDate != ''">
and ep.manufacture_date between #{params.beginManufactureDate} and #{params.endManufactureDate}
</if>
<if test="merchantId != null ">
and ep.merchant_id = #{merchantId}
</if>
<if test="params.submitBeginTime != null and params.submitBeginTime != ''"><!-- 开始时间检索 -->
AND date_format(ep.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(ep.submit_time,'%y%m%d') &lt;= date_format(#{params.submitEndTime},'%y%m%d')
</if>
<if test="auditStatus != null ">
and ep.audit_status = #{auditStatus}
</if>
${params.dataScope}
</where>
order by ep.sort
</select>
<select id="selectZdyEateryProductById" parameterType="Long"
resultMap="ZdyEateryProductZdyEateryProductSpecsResult">
select a.id,
a.name,
a.type,
a.img,
a.sale_prise,
a.code,
a.manufacture_date,
a.status,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.remark,
a.merchant_id,
b.id as
sub_id,
b.product_id as
sub_product_id,
b.name as
sub_name,
b.price as
sub_price,
b.create_by as
sub_create_by,
b.create_time as
sub_create_time,
b.update_by as
sub_update_by,
b.update_time as
sub_update_time,
b.remark as
sub_remark,
b.merchant_id as
sub_merchant_id,
a.sort,
a.submit_time,
a.audit_status,
a.audit_time,
a.reject_reason,
a.flag
from zdy_eatery_product a
left join zdy_eatery_product_specs b on b.product_id = a.id
where a.id = #{id}
</select>
<select id="selectZdyEateryProductByName" resultType="com.zhwl.eatery.domain.ZdyEateryProduct">
select id, name, type, img, sale_prise, code, manufacture_date, sort, create_by, create_time, update_by,
update_time, remark, merchant_id, delete_flag
from zdy_eatery_product a
where delete_flag = 0 and a.name = #{name}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</select>
<select id="selectZdyEateryProductListWithoutLogin" parameterType="ZdyEateryProduct"
resultMap="ZdyEateryProductResult">
<include refid="selectZdyEateryProductVo"/>
left join zdy_store_base_info sbi on d.dept_id = sbi.dept_id
<where>
and ep.delete_flag = 0
and sbi.register_audit_status = 'APPROVED'
and sbi.grounding_status = 'up'
<if test="name != null and name != ''">
and ep.name like concat('%', #{name}, '%')
</if>
<if test="type != null and type != ''">
and ep.type = #{type}
</if>
<if test="img != null and img != ''">
and ep.img = #{img}
</if>
<if test="code != null and code != ''">
and ep.code = #{code}
</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and ep.manufacture_date between #{params.beginTime} and #{params.endTime}
</if>
<if test="params.beginManufactureDate != null and params.beginManufactureDate != '' and params.endManufactureDate != null and params.endManufactureDate != ''">
and ep.manufacture_date between #{params.beginManufactureDate} and #{params.endManufactureDate}
</if>
<if test="merchantId != null ">
and ep.merchant_id = #{merchantId}
</if>
<if test="auditStatus != null ">
and ep.audit_status = #{auditStatus}
</if>
<if test="status != null and status!=''">
and ep.status = #{status}
</if>
</where>
order by sort
</select>
<select id="selectZdyEateryProductListByTypeId" resultMap="ZdyEateryProductResult">
<include refid="selectZdyEateryProductVo"/>
left join zdy_store_base_info sbi on d.dept_id = sbi.dept_id
<where>
and ep.delete_flag = 0
and ep.status = 'up'
and ep.audit_status = 2
and sbi.register_audit_status = 'APPROVED'
and sbi.grounding_status = 'up'
<if test="productSet != null and productSet != ''">
AND ep.id in
<foreach collection="productSet " item="item" open=" (" close=")"
separator=",">
#{item}
</foreach>
</if>
<if test="typeId != null and typeId != ''">
and ep.type = #{typeId}
</if>
</where>
order by ep.sort
</select>
<insert id="insertZdyEateryProduct" parameterType="ZdyEateryProduct" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,
</if>
<if test="type != null">type,
</if>
<if test="img != null">img,
</if>
<if test="salePrise != null">sale_prise,
</if>
<if test="code != null">code,
</if>
<if test="manufactureDate != null">manufacture_date,
</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>
<if test="sort != null">sort,
</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="flag != null ">flag,
</if>
<if test="status != null ">status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},
</if>
<if test="type != null">#{type},
</if>
<if test="img != null">#{img},
</if>
<if test="salePrise != null">#{salePrise},
</if>
<if test="code != null">#{code},
</if>
<if test="manufactureDate != null">#{manufactureDate},
</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>
<if test="sort != null">#{sort},
</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="flag != null ">#{flag},
</if>
<if test="status != null ">#{status},
</if>
</trim>
</insert>
<update id="updateZdyEateryProduct" parameterType="ZdyEateryProduct">
update zdy_eatery_product
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name =
#{name},
</if>
<if test="type != null">type =
#{type},
</if>
<if test="img != null">img =
#{img},
</if>
<if test="salePrise != null">sale_prise =
#{salePrise},
</if>
<if test="manufactureDate != null">manufacture_date =
#{manufactureDate},
</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="sort != null">sort =
#{sort},
</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="flag != null ">flag = #{flag},
</if>
</trim>
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<update id="offAll" parameterType="java.lang.Long">
UPDATE `zdy_eatery_product`
SET `status` = 'down'
where merchant_id = #{merchantId}
</update>
<update id="on">
UPDATE `zdy_eatery_product` SET `status` = #{status}
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<update id="offByIds">
UPDATE `zdy_eatery_product` SET `status` = 'down' where id in
<foreach item="productId" collection="ids" open="(" separator="," close=")">
#{productId}
</foreach>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<delete id="deleteZdyEateryProductById" parameterType="Long">
update zdy_eatery_product SET `delete_flag` = '1' where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</delete>
<delete id="deleteZdyEateryProductByIds" parameterType="String">
delete from zdy_eatery_product where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteZdyEateryProductSpecsByProductIds" parameterType="String">
delete from zdy_eatery_product_specs where product_id in
<foreach item="productId" collection="array" open="(" separator="," close=")">
#{productId}
</foreach>
</delete>
<delete id="deleteZdyEateryProductSpecsByProductId" parameterType="Long">
delete
from zdy_eatery_product_specs
where product_id = #{productId}
</delete>
<insert id="batchZdyEateryProductSpecs">
insert into zdy_eatery_product_specs
( id , product_id , name , price , create_by , create_time , update_by , update_time , remark , merchant_id)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id
}, #{item.productId
}, #{item.name
}, #{item.price
}, #{item.createBy
}, #{item.createTime
}, #{item.updateBy
}, #{item.updateTime
}, #{item.remark
}, #{item.merchantId
})
</foreach>
</insert>
<select id="selectZdyEateryProductListByDeptIdAndProductType"
resultMap="ZdyEateryProductResult">
select *
from zdy_eatery_product
<where>
delete_flag = 0
<if test="deptId!=null">
and merchant_id = #{deptId}
</if>
<if test="types != null and types.size() > 0">
and type in
<foreach collection="types" item="type" separator="," open="(" close=")">
#{type}
</foreach>
</if>
</where>
</select>
<delete id="deleteByDeptIds" parameterType="long">
update zdy_eatery_product SET `delete_flag` = 1 where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId}
</foreach>
</delete>
<delete id="deleteSpecsByDeptIds" parameterType="long">
delete zdy_eatery_product where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,264 @@
<?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.ZdyEateryShopInfoMapper">
<resultMap type="ZdyEateryShopInfo" id="ZdyEateryShopInfoResult">
<result property="id" column="id"/>
<result property="shopName" column="shop_name"/>
<result property="shopPhone" column="shop_phone"/>
<result property="beginTime" column="begin_time"/>
<result property="endTime" column="end_time"/>
<result property="productIds" column="product_ids"/>
<result property="shopAddress" column="shop_address"/>
<result property="shopCuisine" column="shop_cuisine"/>
<result property="averageConsumption" column="average_consumption"/>
<result property="lng" column="lng"/>
<result property="lat" column="lat"/>
<result property="doorImage" column="door_image"/>
<result property="environmentImage" column="environment_image"/>
<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="isRecommend" column="is_recommend"/>
<result property="storeId" column="store_id"/>
<result property="registerAuditStatus" column="register_audit_status"/>
</resultMap>
<sql id="selectZdyEateryShopInfoVo">
select ea.id,
ea.product_ids,
ea.shop_cuisine,
ea.average_consumption,
ea.is_recommend,
ea.store_id,
sbi.name shop_name,
sbi.contact_phone shop_phone,
sbi.business_start_hours begin_time,
sbi.business_end_hours end_time,
sbi.address shop_address,
sbi.longitude lng,
sbi.latitude lat,
sbi.images door_image,
sbi.carousel_image environment_image,
sbi.grounding_status status,
sbi.register_audit_status register_audit_status,
sbi.create_by,
sbi.create_time,
sbi.update_by,
sbi.update_time,
sbi.remark,
sbi.dept_id merchant_id
from zdy_eatery_shop_info ea
inner join zdy_store_base_info sbi on sbi.id = ea.store_id
</sql>
<select id="selectZdyEateryShopInfoList" parameterType="ZdyEateryShopInfo" resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
left join sys_dept d on sbi.dept_id = d.dept_id
<where>
<if test="registerAuditStatus != null and registerAuditStatus != ''">
and sbi.register_audit_status = #{registerAuditStatus}
</if>
<if test="shopName != null and shopName != ''">
and sbi.name like concat('%', #{shopName}, '%')
</if>
<choose>
<when test="statusArray != null and statusArray.length != 0">
and sbi.grounding_status in
<foreach item="status" collection="statusArray" open="(" separator="," close=")">
#{status}
</foreach>
</when>
<otherwise>
<if test="status != null and status != ''">
and sbi.grounding_status = #{status}
</if>
</otherwise>
</choose>
<if test="ids != null and ids.size() != 0">
and ea.id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyEateryShopInfoListApp" parameterType="ZdyEateryShopInfo" resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
<where>
sbi.del_flag = 0
<if test="shopName != null and shopName != ''">
and sbi.name like concat('%', #{shopName}, '%')
</if>
<if test="merchantId != null ">
and sbi.dept_id = #{merchantId}
</if>
<if test="isRecommend != null and isRecommend != ''">
and ea.is_recommend = #{isRecommend}
</if>
<if test="status!= null and status != ''">
and sbi.grounding_status = #{status}
</if>
<if test="registerAuditStatus!= null and registerAuditStatus != ''">
and sbi.register_audit_status = #{registerAuditStatus}
</if>
</where>
</select>
<select id="selectZdyEateryShopInfoById" parameterType="Long"
resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
where ea.id = #{id}
</select>
<insert id="insertZdyEateryShopInfo" parameterType="ZdyEateryShopInfo" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_shop_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="storeId != null">
id,
</if>
<if test="productIds != null">product_ids,
</if>
<if test="shopCuisine != null">shop_cuisine,
</if>
<if test="averageConsumption != null">average_consumption,
</if>
<if test="isRecommend != null">is_recommend,
</if>
<if test="storeId != null">
store_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="storeId != null">#{storeId},
</if>
<if test="productIds != null">#{productIds},
</if>
<if test="shopCuisine != null">#{shopCuisine},
</if>
<if test="averageConsumption != null">#{averageConsumption},
</if>
<if test="isRecommend != null">#{isRecommend},
</if>
<if test="storeId != null">
#{storeId},
</if>
</trim>
</insert>
<update id="updateZdyEateryShopInfo" parameterType="ZdyEateryShopInfo">
update zdy_eatery_shop_info
<trim prefix="SET" suffixOverrides=",">
<if test="productIds != null">product_ids =
#{productIds},
</if>
<if test="shopCuisine != null">shop_cuisine =
#{shopCuisine},
</if>
<if test="averageConsumption != null">average_consumption =
#{averageConsumption},
</if>
<if test="isRecommend != null">is_recommend =
#{isRecommend},
</if>
<if test="storeId != null">
store_id = #{storeId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyEateryShopInfoById" parameterType="Long">
delete
from zdy_eatery_shop_info
where id = #{id}
</delete>
<delete id="deleteZdyEateryShopInfoByIds" parameterType="String">
delete from zdy_eatery_shop_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countByShopName" resultType="int">
select count(1)
from zdy_eatery_shop_info esi
inner join zdy_store_base_info sbi on esi.store_id = sbi.id
where sbi.name = #{shopName}
</select>
<select id="selectZdyEateryShopInfoByIds" resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
<where>
<if test="ids != null and ids.size() != 0">
and ea.id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="getByMerchantId" parameterType="Long" resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
where sbi.dept_id = #{deptId}
</select>
<update id="updateStoreInfoByStoreId" parameterType="ZdyEateryShopInfo">
update zdy_eatery_shop_info
<trim prefix="SET" suffixOverrides=",">
<if test="productIds != null">product_ids =
#{productIds},
</if>
<if test="shopCuisine != null">shop_cuisine =
#{shopCuisine},
</if>
<if test="averageConsumption != null">average_consumption =
#{averageConsumption},
</if>
<if test="isRecommend != null">is_recommend =
#{isRecommend},
</if>
<if test="storeId != null">
store_id = #{storeId}
</if>
</trim>
where store_id = #{storeId}
</update>
<select id="getByStoreId" parameterType="Long" resultMap="ZdyEateryShopInfoResult">
<include refid="selectZdyEateryShopInfoVo"/>
where store_id = #{storeId}
</select>
<select id="selectBaseList" resultType="java.util.Map">
SELECT
b.id,
b.name as shopName,
b.contact_name as contactName,
b.contact_phone as shopPhone,
b.business_start_hours as beginTime,
b.business_end_hours as endTime,
b.address as address,
b.longitude as lng,
b.latitude as lat,
b.images as image,
b.legal_person_name as legalPersonName,
b.legal_person_phone as legalPersonPhone,
b.business_license as businessLicense
FROM
zdy_eatery_shop_info e
LEFT JOIN zdy_store_base_info b on e.store_id=b.id where !ISNULL(b.id)
</select>
</mapper>

View File

@@ -0,0 +1,137 @@
<?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.ZdyEateryTableAreaMapper">
<resultMap type="ZdyEateryTableArea" id="ZdyEateryTableAreaResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="sort" column="sort"/>
<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"/>
</resultMap>
<sql id="selectZdyEateryTableAreaVo">
select eta.id, eta.name, eta.sort, eta.create_by, eta.create_time, eta.update_by, eta.update_time, eta.remark, eta.merchant_id
from zdy_eatery_table_area eta
left join sys_dept d on eta.merchant_id = d.dept_id
</sql>
<select id="selectZdyEateryTableAreaList" parameterType="ZdyEateryTableArea" resultMap="ZdyEateryTableAreaResult">
<include refid="selectZdyEateryTableAreaVo"/>
<where>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="merchantId != null ">
and merchant_id = #{merchantId}
</if>
${params.dataScope}
</where>
order by sort
</select>
<select id="selectZdyEateryTableAreaById" parameterType="Long"
resultMap="ZdyEateryTableAreaResult">
<include refid="selectZdyEateryTableAreaVo"/>
where id = #{id}
</select>
<insert id="insertZdyEateryTableArea" parameterType="ZdyEateryTableArea" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_eatery_table_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,
</if>
<if test="sort != null">sort,
</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="sort != null">#{sort},
</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="updateZdyEateryTableArea" parameterType="ZdyEateryTableArea">
update zdy_eatery_table_area
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name =
#{name},
</if>
<if test="sort != null">sort =
#{sort},
</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>
</trim>
where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</update>
<delete id="deleteZdyEateryTableAreaById" parameterType="Long">
delete from zdy_eatery_table_area where id = #{id}
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
</delete>
<delete id="deleteZdyEateryTableAreaByIds" parameterType="String">
delete from zdy_eatery_table_area where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteByDeptIds" parameterType="long">
delete from zdy_eatery_table_area where merchant_id in
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
#{deptId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,200 @@
<?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>