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,158 @@
<?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>

View File

@@ -0,0 +1,63 @@
<?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.ZdySalesPointTicketMachineMapper">
<resultMap type="ZdySalesPointTicketMachine" id="ZdySalesPointTicketMachineResult">
<result property="salesPointId" column="sales_point_id"/>
<result property="ticketMachineId" column="ticket_machine_id"/>
</resultMap>
<sql id="selectZdySalesPointTicketMachineVo">
select sales_point_id, ticket_machine_id
from zdy_sales_point_ticket_machine
</sql>
<select id="listTicketMachineIdsBySalesPointId" parameterType="Long" resultType="Long">
select ticket_machine_id
from zdy_sales_point_ticket_machine
where sales_point_id = #{salesPointId}
</select>
<insert id="insertZdySalesPointTicketMachine" parameterType="ZdySalesPointTicketMachine">
insert into zdy_sales_point_ticket_machine
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">sales_point_id,
</if>
<if test="ticketMachineId != null">ticket_machine_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">#{salesPointId},
</if>
<if test="ticketMachineId != null">#{ticketMachineId},
</if>
</trim>
</insert>
<delete id="deleteBySalesPointIdAndTicketMachineIds">
delete from zdy_sales_point_ticket_machine where sales_point_id = #{salesPointId} and ticket_machine_id in
<foreach item="ticketMachineId" collection="ticketMachineIds" open="(" separator="," close=")">
#{ticketMachineId}
</foreach>
</delete>
<delete id="deleteBySalesPointIds">
delete from zdy_sales_point_ticket_machine
where
sales_point_id in
<foreach item="salesPointId" collection="array" open="(" separator="," close=")">
#{salesPointId}
</foreach>
</delete>
<select id="listTicketMachineIdsExcludingSalesPoint" parameterType="Long" resultType="Long">
select ticket_machine_id
from zdy_sales_point_ticket_machine
<where>
<if test="salesPointId != null">sales_point_id != #{salesPointId}</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,77 @@
<?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.ZdySalesPointTicketMapper">
<resultMap type="ZdySalesPointTicket" id="ZdySalesPointTicketResult">
<result property="salesPointId" column="sales_point_id"/>
<result property="ticketId" column="ticket_id"/>
</resultMap>
<sql id="selectZdySalesPointTicketVo">
select sales_point_id, ticket_id
from zdy_sales_point_ticket
</sql>
<select id="listTicketIdsBySalesPointId" parameterType="Long" resultType="Long">
select ticket_id
from zdy_sales_point_ticket
where sales_point_id = #{salesPointId}
</select>
<insert id="insertZdySalesPointTicket" parameterType="ZdySalesPointTicket">
insert into zdy_sales_point_ticket
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">sales_point_id,
</if>
<if test="ticketId != null">ticket_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">#{salesPointId},
</if>
<if test="ticketId != null">#{ticketId},
</if>
</trim>
</insert>
<delete id="deleteByTicketId" parameterType="Long">
delete
from zdy_sales_point_ticket
where ticket_id = #{ticketId}
</delete>
<delete id="deleteBySalesPointIdAndTicketIds">
delete from zdy_sales_point_ticket where sales_point_id = #{salesPointId} and ticket_id in
<foreach item="ticketId" collection="ticketIds" open="(" separator="," close=")">
#{ticketId}
</foreach>
</delete>
<select id="listTicketIdsByUserId" resultType="java.lang.Long">
SELECT DISTINCT ticket_id
FROM zdy_sales_point_ticket
WHERE sales_point_id IN (SELECT sales_point_id
FROM zdy_sales_point_user
WHERE user_id = #{userId})
</select>
<select id="listTicketIdsByTicketMachineId" resultType="java.lang.Long">
SELECT DISTINCT ticket_id
FROM zdy_sales_point_ticket
WHERE sales_point_id IN (SELECT sales_point_id
FROM zdy_sales_point_ticket_machine
WHERE ticket_machine_id = #{ticketMachineId})
</select>
<delete id="deleteBySalesPointIds">
delete from zdy_sales_point_ticket
where
sales_point_id in
<foreach item="salesPointId" collection="array" open="(" separator="," close=")">
#{salesPointId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,55 @@
<?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.ZdySalesPointUserMapper">
<resultMap type="ZdySalesPointUser" id="ZdySalesPointUserResult">
<result property="salesPointId" column="sales_point_id"/>
<result property="userId" column="user_id"/>
</resultMap>
<sql id="selectZdySalesPointUserVo">
select sales_point_id, user_id
from zdy_sales_point_user
</sql>
<select id="listUserIdsBySalesPointId" parameterType="Long" resultType="Long">
select user_id
from zdy_sales_point_user
where sales_point_id = #{salesPointId}
</select>
<insert id="insertZdySalesPointUser" parameterType="ZdySalesPointUser">
insert into zdy_sales_point_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">sales_point_id,
</if>
<if test="userId != null">user_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="salesPointId != null">#{salesPointId},
</if>
<if test="userId != null">#{userId},
</if>
</trim>
</insert>
<delete id="deleteBySalesPointIdAndUserIds">
delete from zdy_sales_point_user where sales_point_id = #{salesPointId} and user_id in
<foreach item="userId" collection="userIds" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<delete id="deleteBySalesPointIds">
delete from zdy_sales_point_user
where
sales_point_id in
<foreach item="salesPointId" collection="array" open="(" separator="," close=")">
#{salesPointId}
</foreach>
</delete>
</mapper>