zhwl/zhwl-business/zhwl-sales-point/target/classes/mapper/business/ZdySalesPointMapper.xml

159 lines
5.9 KiB
XML
Raw Permalink Normal View History

2025-07-01 17:54:58 +08:00
<?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.sales.point.mapper.ZdySalesPointMapper">
<resultMap type="ZdySalesPoint" id="ZdySalesPointResult">
<result property="id" column="id"/>
<result property="pointName" column="point_name"/>
<result property="salesPointType" column="sales_point_type"/>
<result property="createTime" column="create_time"/>
<result property="createdByUserId" column="created_by_user_id"/>
<result property="updateTime" column="update_time"/>
<result property="updatedByUserId" column="updated_by_user_id"/>
<result property="deptId" column="dept_id"/>
<result property="deleted" column="is_deleted"/>
<result property="scenicId" column="scenic_id"/>
<result property="scenicName" column="scenic_name"/>
</resultMap>
<sql id="selectZdySalesPointVo">
select zsp.id,
zsp.point_name,
zsp.sales_point_type,
zsp.create_time,
zsp.created_by_user_id,
zsp.update_time,
zsp.updated_by_user_id,
zsp.dept_id,
zsp.is_deleted,
zsp.scenic_id,
zs.scenic_name
from zdy_sales_point zsp
left join zdy_scenic zs on zs.id = zsp.scenic_id
</sql>
<select id="selectZdySalesPointList" parameterType="ZdySalesPoint" resultMap="ZdySalesPointResult">
<include refid="selectZdySalesPointVo"/>
<where>
zsp.is_deleted = 0
<if test="pointName != null and pointName != ''">
and zsp.point_name like concat('%', #{pointName}, '%')
</if>
<if test="salesPointType != null and salesPointType != ''">
and zsp.sales_point_type = #{salesPointType}
</if>
<if test="createdByUserId != null ">
and zsp.created_by_user_id = #{createdByUserId}
</if>
<if test="updatedByUserId != null ">
and zsp.updated_by_user_id = #{updatedByUserId}
</if>
<if test="deptId != null ">
and zsp.dept_id = #{deptId}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdySalesPointById" parameterType="Long"
resultMap="ZdySalesPointResult">
<include refid="selectZdySalesPointVo"/>
where zsp.id = #{id}
</select>
<insert id="insertZdySalesPoint" parameterType="ZdySalesPoint" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_sales_point
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pointName != null and pointName != ''">point_name,
</if>
<if test="salesPointType != null and salesPointType != ''">sales_point_type,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createdByUserId != null">created_by_user_id,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updatedByUserId != null">updated_by_user_id,
</if>
<if test="deptId != null">dept_id,
</if>
<if test="deleted != null">is_deleted,
</if>
<if test="scenicId != null">scenic_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pointName != null and pointName != ''">#{pointName},
</if>
<if test="salesPointType != null and salesPointType != ''">#{salesPointType},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createdByUserId != null">#{createdByUserId},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updatedByUserId != null">#{updatedByUserId},
</if>
<if test="deptId != null">#{deptId},
</if>
<if test="deleted != null">#{deleted},
</if>
<if test="scenicId != null">#{scenicId},
</if>
</trim>
</insert>
<update id="updateZdySalesPoint" parameterType="ZdySalesPoint">
update zdy_sales_point
<trim prefix="SET" suffixOverrides=",">
<if test="pointName != null and pointName != ''">point_name =
#{pointName},
</if>
<if test="salesPointType != null and salesPointType != ''">sales_point_type =
#{salesPointType},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createdByUserId != null">created_by_user_id =
#{createdByUserId},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updatedByUserId != null">updated_by_user_id =
#{updatedByUserId},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="deleted != null">is_deleted =
#{deleted},
</if>
<if test="scenicId != null">scenic_id =
#{scenicId},
</if>
</trim>
where id = #{id}
</update>
<update id="deleteZdySalesPointById" parameterType="Long">
update zdy_sales_point
set is_deleted = 1
where id = #{id}
</update>
<update id="deleteZdySalesPointByIds" parameterType="String">
update zdy_sales_point set is_deleted = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>