138 lines
4.9 KiB
XML
138 lines
4.9 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.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>
|