支付
This commit is contained in:
@@ -0,0 +1,213 @@
|
||||
<?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.ticket.mapper.ZdyTicketApplicablePeriodMapper">
|
||||
|
||||
<resultMap type="ZdyTicketApplicablePeriod" id="ZdyTicketApplicablePeriodResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="timeQuantum" column="time_quantum"/>
|
||||
<result property="inventory" column="inventory"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="isInventory" column="is_inventory"/>
|
||||
<result property="isPrice" column="is_price"/>
|
||||
<result property="playTime" column="play_time"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketApplicablePeriodVo">
|
||||
select id,
|
||||
ticket_id,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
remark,
|
||||
time_quantum,
|
||||
inventory,
|
||||
price,
|
||||
is_inventory,
|
||||
is_price,
|
||||
play_time
|
||||
from zdy_ticket_applicable_period
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketApplicablePeriodList" parameterType="ZdyTicketApplicablePeriod"
|
||||
resultMap="ZdyTicketApplicablePeriodResult">
|
||||
<include refid="selectZdyTicketApplicablePeriodVo"/>
|
||||
<where>
|
||||
<if test="ticketId != null ">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test="playTime != null ">
|
||||
and play_time = #{playTime}
|
||||
</if>
|
||||
<if test="timeQuantum != null ">
|
||||
and time_quantum = #{timeQuantum}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketApplicablePeriodById" parameterType="Long"
|
||||
resultMap="ZdyTicketApplicablePeriodResult">
|
||||
<include refid="selectZdyTicketApplicablePeriodVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketApplicablePeriod" parameterType="ZdyTicketApplicablePeriod" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_applicable_period
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="remark != null">remark,
|
||||
</if>
|
||||
<if test="timeQuantum != null">time_quantum,
|
||||
</if>
|
||||
<if test="inventory != null">inventory,
|
||||
</if>
|
||||
<if test="price != null">price,
|
||||
</if>
|
||||
<if test="isInventory != null">is_inventory,
|
||||
</if>
|
||||
<if test="isPrice != null">is_price,
|
||||
</if>
|
||||
<if test="playTime != null">play_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="remark != null">#{remark},
|
||||
</if>
|
||||
<if test="timeQuantum != null">#{timeQuantum},
|
||||
</if>
|
||||
<if test="inventory != null">#{inventory},
|
||||
</if>
|
||||
<if test="price != null">#{price},
|
||||
</if>
|
||||
<if test="isInventory != null">#{isInventory},
|
||||
</if>
|
||||
<if test="isPrice != null">#{isPrice},
|
||||
</if>
|
||||
<if test="playTime != null">#{playTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketApplicablePeriod" parameterType="ZdyTicketApplicablePeriod">
|
||||
update zdy_ticket_applicable_period
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id =
|
||||
#{ticketId},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="remark != null">remark =
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="timeQuantum != null">time_quantum =
|
||||
#{timeQuantum},
|
||||
</if>
|
||||
<if test="inventory != null">inventory =
|
||||
#{inventory},
|
||||
</if>
|
||||
<if test="price != null">price =
|
||||
#{price},
|
||||
</if>
|
||||
<if test="isInventory != null">is_inventory =
|
||||
#{isInventory},
|
||||
</if>
|
||||
<if test="isPrice != null">is_price =
|
||||
#{isPrice},
|
||||
</if>
|
||||
<if test="playTime != null">play_time =
|
||||
#{playTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketApplicablePeriodById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_applicable_period
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketApplicablePeriodByIds" parameterType="String">
|
||||
delete from zdy_ticket_applicable_period where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteZdyTicketApplicablePeriodByTicketId" >
|
||||
delete
|
||||
from zdy_ticket_applicable_period
|
||||
where ticket_id = #{ticketId} and play_time = #{playTime}
|
||||
</delete>
|
||||
<delete id="deleteByTicketId">
|
||||
delete
|
||||
from zdy_ticket_applicable_period
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
|
||||
<select id="selectZdyTicketApplicablePeriodByTicketId" parameterType="Long"
|
||||
resultMap="ZdyTicketApplicablePeriodResult">
|
||||
<include refid="selectZdyTicketApplicablePeriodVo"/>
|
||||
where ticket_id = #{ticketId}
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketApplicablePeriodByTicketIdAndTime" parameterType="com.zhwl.ticket.domain.dto.TimeInventoryDTO"
|
||||
resultMap="ZdyTicketApplicablePeriodResult">
|
||||
<include refid="selectZdyTicketApplicablePeriodVo"/>
|
||||
where ticket_id = #{ticketId} and time_quantum = #{timeQuantum} and play_time = #{playTime} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectInventoryByParam" parameterType="com.zhwl.ticket.domain.dto.TimeInventoryDTO"
|
||||
resultType="Long">
|
||||
select sum(inventory) as inventory
|
||||
from zdy_ticket_applicable_period
|
||||
where ticket_id = #{ticketId}
|
||||
<choose>
|
||||
<when test="playTime != null">
|
||||
and play_time = #{playTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
and play_time >= now()
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,181 @@
|
||||
<?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.ticket.mapper.ZdyTicketChildMapper">
|
||||
|
||||
<resultMap type = "ZdyTicketChild" id = "ZdyTicketChildResult">
|
||||
<result property = "ticketId" column = "ticket_id"/>
|
||||
<result property = "childTicketId" column = "child_ticket_id"/>
|
||||
<result property = "childTicketName" column = "child_ticket_name"/>
|
||||
<result property = "canVerificationNum" column = "can_verification_num"/>
|
||||
<result property = "dayVerificationNum" column = "day_verification_num"/>
|
||||
<result property = "monthVerificationNum" column = "month_verification_num"/>
|
||||
<result property = "isUnlimited" column = "is_unlimited"/>
|
||||
<result property = "childScenicId" column = "child_scenic_id"/>
|
||||
<result property = "settlementPrice" column = "settlement_price"/>
|
||||
<result property = "rights" column = "rights"/>
|
||||
<result property = "salesRice" column = "sales_rice"/>
|
||||
<result property = "price" column = "price"/>
|
||||
<result property = "image11" column = "image11"/>
|
||||
<result property = "childScenicName" column = "child_scenic_name"/>
|
||||
<association property="zdyScenic" javaType="ZdyScenic" resultMap="ZdyScenicResult"/>
|
||||
</resultMap>
|
||||
<resultMap type = "ZdyScenic" id = "ZdyScenicResult">
|
||||
<result property = "id" column = "child_scenic_id"/>
|
||||
<result property = "scenicName" column = "child_scenic_name"/>
|
||||
<result property = "scenicLevel" column = "child_scenic_level"/>
|
||||
<result property = "imagePage" column = "child_image_page"/>
|
||||
<result property = "scenicLevelName" column = "child_scenic_level_name"/>
|
||||
<collection property = "tagList" javaType = "java.util.List" ofType = "ZdyScenicTags"
|
||||
select = "selectZdyScenicTagsByScenicId" column = "child_scenic_id"/>
|
||||
</resultMap>
|
||||
<resultMap type = "ZdyScenicTags" id = "ZdyScenicTagsResult">
|
||||
<result property = "id" column = "tag_id"/>
|
||||
<result property = "name" column = "tag_name"/>
|
||||
<result property = "scenicId" column = "tag_scenic_id"/>
|
||||
</resultMap>
|
||||
|
||||
<select id = "selectZdyScenicTagsByScenicId" parameterType = "Long" resultMap = "ZdyScenicTagsResult">
|
||||
select id as tag_id, name as tag_name, scenic_id as tag_scenic_id
|
||||
from zdy_scenic_tags
|
||||
where scenic_id = #{child_scenic_id}
|
||||
</select>
|
||||
|
||||
<sql id = "selectZdyTicketChildVo">
|
||||
select child.ticket_id,
|
||||
child.child_ticket_id,
|
||||
child.child_ticket_name,
|
||||
child.can_verification_num,
|
||||
child.day_verification_num,
|
||||
child.month_verification_num,
|
||||
child.is_unlimited,
|
||||
child.child_scenic_id,
|
||||
child.settlement_price,
|
||||
child.rights,
|
||||
ticket.sales_rice,
|
||||
ticket.price,
|
||||
ticket.image11,
|
||||
sc.scenic_name as child_scenic_name,
|
||||
sc.scenic_level as child_scenic_level,
|
||||
sc.id as child_scenic_id,
|
||||
sc.image_page as child_image_page,
|
||||
sdd.dict_label as child_scenic_level_name
|
||||
from zdy_ticket_child child
|
||||
left join zdy_scenic sc on child.child_scenic_id = sc.id
|
||||
left join zdy_ticket ticket on child.child_ticket_id = ticket.id
|
||||
left join sys_dict_data sdd on sdd.dict_value = sc.scenic_level and sdd.dict_type='scenic_level'
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyTicketChildList" parameterType = "ZdyTicketChild" resultMap = "ZdyTicketChildResult">
|
||||
<include refid = "selectZdyTicketChildVo"/>
|
||||
<where>
|
||||
|
||||
<choose>
|
||||
<when test = "childTicketIds != null and childTicketIds.length != 0">
|
||||
and child.child_ticket_id in
|
||||
<foreach item = "item" collection = "childTicketIds" open = "(" separator = "," close = ")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test = "childTicketId != null ">
|
||||
and child.child_ticket_id = #{childTicketId}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test = "ticketId != null ">
|
||||
and child.ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test = "childTicketName != null and childTicketName != ''">
|
||||
and child.child_ticket_name like concat('%', #{childTicketName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketChildByTicketId" parameterType = "Long" resultMap = "ZdyTicketChildResult">
|
||||
<include refid = "selectZdyTicketChildVo"/>
|
||||
where child.ticket_id = #{ticketId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyTicketChild" parameterType = "ZdyTicketChild">
|
||||
insert into zdy_ticket_child
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "ticketId != null">ticket_id,</if>
|
||||
<if test = "childTicketId != null">child_ticket_id,</if>
|
||||
<if test = "childTicketName != null">child_ticket_name,</if>
|
||||
<if test = "canVerificationNum != null">can_verification_num,</if>
|
||||
<if test = "dayVerificationNum != null">day_verification_num,</if>
|
||||
<if test = "monthVerificationNum != null">month_verification_num,</if>
|
||||
<if test = "isUnlimited != null">is_unlimited,</if>
|
||||
<if test = "childScenicId != null">child_scenic_id,</if>
|
||||
<if test = "settlementPrice != null">settlement_price,</if>
|
||||
<if test = "rights != null">rights,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "ticketId != null">#{ticketId},</if>
|
||||
<if test = "childTicketId != null">#{childTicketId},</if>
|
||||
<if test = "childTicketName != null">#{childTicketName},</if>
|
||||
<if test = "canVerificationNum != null">#{canVerificationNum},</if>
|
||||
<if test = "dayVerificationNum != null">#{dayVerificationNum},</if>
|
||||
<if test = "monthVerificationNum != null">#{monthVerificationNum},</if>
|
||||
<if test = "isUnlimited != null">#{isUnlimited},</if>
|
||||
<if test = "childScenicId != null">#{childScenicId},</if>
|
||||
<if test = "settlementPrice != null">#{settlementPrice},</if>
|
||||
<if test = "rights != null">#{rights},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyTicketChild" parameterType = "ZdyTicketChild">
|
||||
update zdy_ticket_child
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "childTicketId != null">child_ticket_id = #{childTicketId},</if>
|
||||
<if test = "childTicketName != null">child_ticket_name = #{childTicketName},</if>
|
||||
<if test = "canVerificationNum != null">can_verification_num = #{canVerificationNum},</if>
|
||||
<if test = "dayVerificationNum != null">day_verification_num = #{dayVerificationNum},</if>
|
||||
<if test = "monthVerificationNum != null">month_verification_num = #{monthVerificationNum},</if>
|
||||
<if test = "isUnlimited != null">is_unlimited = #{isUnlimited},</if>
|
||||
<if test = "childScenicId != null">child_scenic_id = #{childScenicId},</if>
|
||||
<if test = "settlementPrice != null">settlement_price = #{settlementPrice},</if>
|
||||
<if test = "rights != null">rights = #{rights},</if>
|
||||
</trim>
|
||||
where ticket_id = #{ticketId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyTicketChildByTicketId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_ticket_child
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyTicketChildByTicketIds" parameterType = "String">
|
||||
delete from zdy_ticket_child where ticket_id in
|
||||
<foreach item = "ticketId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{ticketId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id = "selectZdyTicketChildByTicketIdAndChild" resultMap = "ZdyTicketChildResult">
|
||||
<include refid = "selectZdyTicketChildVo"/>
|
||||
where child.ticket_id = #{ticketId} and child.child_ticket_id = #{childTicketId} limit 1
|
||||
</select>
|
||||
<select id="selectTicketIdByChildId" resultType="java.util.Map">
|
||||
select c.ticket_id as ticketId ,GROUP_CONCAT( c.child_ticket_id ) as childTicketIds from zdy_ticket_child c
|
||||
left join zdy_ticket t on t.id=c.ticket_id
|
||||
where t.classify='8' and t.del_flag='0'
|
||||
<choose>
|
||||
<when test="list!=null and list.size() > 0">
|
||||
and c.child_ticket_id in
|
||||
<foreach collection="list" item="childTicketId" open="(" close=")" separator=",">
|
||||
#{childTicketId}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and 0=1
|
||||
</otherwise>
|
||||
</choose>
|
||||
GROUP BY c.ticket_id
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@@ -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.ticket.mapper.ZdyTicketGroupMapper">
|
||||
|
||||
<resultMap type="ZdyTicketGroup" id="ZdyTicketGroupResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="scenicId" column="scenic_id"/>
|
||||
<result property="orgCode" column="org_code"/>
|
||||
<result property="classify" column="classify"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="scenicName" column="scenicName"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketGroupVo">
|
||||
SELECT
|
||||
gr.id,
|
||||
gr.dept_id,
|
||||
gr.NAME,
|
||||
gr.scenic_id,
|
||||
gr.org_code,
|
||||
gr.classify,
|
||||
gr.del_flag,
|
||||
gr.sort,
|
||||
gr.create_time,
|
||||
gr.create_by,
|
||||
gr.update_time,
|
||||
gr.update_by,
|
||||
gr.remark,
|
||||
sc.scenic_name AS scenicName
|
||||
FROM
|
||||
zdy_ticket_group gr
|
||||
LEFT JOIN zdy_scenic sc ON sc.id = gr.scenic_id
|
||||
left join sys_dept d on gr.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketGroupList" parameterType="ZdyTicketGroup" resultMap="ZdyTicketGroupResult">
|
||||
<include refid="selectZdyTicketGroupVo"/>
|
||||
<where>
|
||||
gr.del_flag = 0
|
||||
<if test="name != null and name != ''">
|
||||
and gr.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="scenicId != null ">
|
||||
and gr.scenic_id = #{scenicId}
|
||||
</if>
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
and gr.org_code = #{orgCode}
|
||||
</if>
|
||||
<if test="classify != null and classify != ''">
|
||||
and gr.classify = #{classify}
|
||||
</if>
|
||||
<if test="sort != null ">
|
||||
and gr.sort = #{sort}
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
<if test="params.orderby != null and params.orderway != null">
|
||||
order by gr.${params.orderby} ${params.orderway}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketGroupById" parameterType="Long"
|
||||
resultMap="ZdyTicketGroupResult">
|
||||
<include refid="selectZdyTicketGroupVo"/>
|
||||
where gr.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketGroup" parameterType="ZdyTicketGroup" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="scenicId != null">scenic_id,
|
||||
</if>
|
||||
<if test="orgCode != null">org_code,
|
||||
</if>
|
||||
<if test="classify != null">classify,
|
||||
</if>
|
||||
<if test="delFlag != null">del_flag,
|
||||
</if>
|
||||
<if test="sort != null">sort,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="remark != null">remark,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="scenicId != null">#{scenicId},
|
||||
</if>
|
||||
<if test="orgCode != null">#{orgCode},
|
||||
</if>
|
||||
<if test="classify != null">#{classify},
|
||||
</if>
|
||||
<if test="delFlag != null">#{delFlag},
|
||||
</if>
|
||||
<if test="sort != null">#{sort},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="remark != null">#{remark},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketGroup" parameterType="ZdyTicketGroup">
|
||||
update zdy_ticket_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name =
|
||||
#{name},
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="scenicId != null">scenic_id =
|
||||
#{scenicId},
|
||||
</if>
|
||||
<if test="orgCode != null">org_code =
|
||||
#{orgCode},
|
||||
</if>
|
||||
<if test="classify != null">classify =
|
||||
#{classify},
|
||||
</if>
|
||||
<if test="delFlag != null">del_flag =
|
||||
#{delFlag},
|
||||
</if>
|
||||
<if test="sort != null">sort =
|
||||
#{sort},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="remark != null">remark =
|
||||
#{remark},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketGroupById" parameterType="Long">
|
||||
update
|
||||
zdy_ticket_group
|
||||
set del_flag = '1'
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketGroupByIds" parameterType="String">
|
||||
update
|
||||
zdy_ticket_group
|
||||
set del_flag = '1'
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="existsTicketGroupWithScenicId" resultType="java.lang.Integer">
|
||||
SELECT EXISTS(SELECT 1 FROM zdy_ticket_group WHERE del_flag = '0' and scenic_id = #{scenicId} and name = #{name}
|
||||
<if test="id != null">
|
||||
and id != #{id}
|
||||
</if>)
|
||||
</select>
|
||||
<select id="selectByScenicId" resultMap="ZdyTicketGroupResult">
|
||||
SELECT * FROM zdy_ticket_group where scenic_id = #{scenicId}
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,921 @@
|
||||
<?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.ticket.mapper.ZdyTicketMapper">
|
||||
|
||||
<resultMap type = "ZdyTicket" id = "ZdyTicketResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "name" column = "name"/>
|
||||
<result property = "scenicId" column = "scenic_id"/>
|
||||
<result property = "salesRice" column = "sales_rice"/>
|
||||
<result property = "price" column = "price"/>
|
||||
<result property = "image" column = "image"/>
|
||||
<result property = "classify" column = "classify"/>
|
||||
<result property = "groundingFlag" column = "grounding_flag"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
<result property = "remark" column = "remark"/>
|
||||
<result property = "scenicName" column = "scenic_name"/>
|
||||
<result property = "delFlag" column = "del_flag"/>
|
||||
<result property = "inventory" column = "inventory"/>
|
||||
<result property = "flag" column = "flag"/>
|
||||
<result property = "minPrice" column = "minPrice"/>
|
||||
<result property = "refundRule" column = "refund_rule"/>
|
||||
<result property = "refundRuleName" column = "refundRuleName"/>
|
||||
<result property = "isFee" column = "is_fee"/>
|
||||
<result property = "classifyName" column = "classifyName"/>
|
||||
<result property = "isOrder" column = "is_order"/>
|
||||
<result property = "validityStartTime" column = "validity_start_time"/>
|
||||
<result property = "validityEndTime" column = "validity_end_time"/>
|
||||
<result property = "groupId" column = "group_id"/>
|
||||
<result property = "bookingNotice" column = "booking_notice"/>
|
||||
<result property = "beforeDay" column = "before_day"/>
|
||||
<result property = "isOrderQuantity" column = "is_order_quantity"/>
|
||||
<result property = "orderQuantity" column = "order_quantity"/>
|
||||
<result property = "authenticationType" column = "authentication_type"/>
|
||||
<result property = "verifySettings" column = "verify_settings"/>
|
||||
<result property = "isPurchaseDate" column = "is_purchase_date"/>
|
||||
<result property = "purchStartDate" column = "purch_start_date"/>
|
||||
<result property = "purchEndDate" column = "purch_end_date"/>
|
||||
<result property = "ticketValidityPeriod" column = "ticket_validity_period"/>
|
||||
<result property = "buyPeriodDay" column = "buy_period_day"/>
|
||||
<result property = "adjust" column = "adjust"/>
|
||||
<result property = "groupName" column = "groupName"/>
|
||||
<result property = "groupId" column = "group_id"/>
|
||||
<result property = "classifyName" column = "classifyName"/>
|
||||
<result property = "admissionAddress" column = "admission_address"/>
|
||||
<result property = "admissionTime" column = "admission_time"/>
|
||||
<result property = "sales" column = "sales"/>
|
||||
<result property = "image11" column = "image11"/>
|
||||
<result property = "image43" column = "image43"/>
|
||||
<result property = "feeType" column = "fee_type"/>
|
||||
<result property = "deductionFees" column = "deduction_fees"/>
|
||||
<result property = "deductionFeesUnit" column = "deduction_fees_unit"/>
|
||||
<result property = "refundDay" column = "refund_day"/>
|
||||
<result property = "qrcodeRule" column = "qrcode_rule"/>
|
||||
<result property = "isRefundCheck" column = "is_refund_check"/>
|
||||
<result property = "isReservation" column = "is_reservation"/>
|
||||
<result property = "applicablePeriod" column = "applicable_period"/>
|
||||
<result property = "sort" column = "sort"/>
|
||||
<result property = "saleResource" column = "sale_resource"/>
|
||||
<result property = "isDelay" column = "is_delay"/>
|
||||
<result property = "delayHour" column = "delay_hour"/>
|
||||
<result property = "delayMinute" column = "delay_minute"/>
|
||||
<result property = "isUnavailableTime" column = "is_unavailable_time"/>
|
||||
<result property = "isSpecial" column = "is_special"/>
|
||||
<result property = "specialType" column = "special_type"/>
|
||||
<result property = "specialTicket" column = "special_ticket"/>
|
||||
<result property = "yearOldStart" column = "year_old_start"/>
|
||||
<result property = "yearOldEnd" column = "year_old_end"/>
|
||||
<result property = "sex" column = "sex"/>
|
||||
<result property = "specialAreaTicket" column = "special_area_ticket"/>
|
||||
<result property = "deptId" column = "dept_id"/>
|
||||
<result property = "isPurchaseTime" column = "is_purchase_time"/>
|
||||
<result property = "purchStartTime" column = "purch_start_time"/>
|
||||
<result property = "purchEndTime" column = "purch_end_time"/>
|
||||
<result property = "isUnavailableHoliday" column = "is_unavailable_holiday"/>
|
||||
<result property = "limitedPeople" column = "limited_people"/>
|
||||
<result property = "otaResource" column = "ota_resource"/>
|
||||
<result property = "agreement" column = "agreement"/>
|
||||
<result property = "introduce" column = "introduce"/>
|
||||
<result property = "childRestrictions" column = "child_restrictions"/>
|
||||
<result property = "verificationMode" column = "verification_mode"/>
|
||||
<result property = "activeMode" column = "active_mode"/>
|
||||
<result property = "isLimitedActive" column = "is_limited_active"/>
|
||||
<result property = "limitedActiveNum" column = "limited_active_num"/>
|
||||
<result property="tags" column="tags"/>
|
||||
<result property="purchaseReminder" column="purchase_reminder"/>
|
||||
<result property="ticketSupplier" column="ticket_supplier"/>
|
||||
<result property="pftScenicId" column="pft_scenic_id"/>
|
||||
<result property="pftTicketId" column="pft_ticket_id"/>
|
||||
<result property="pftSupplierId" column="pft_supplier_id"/>
|
||||
<result property="pftPriceId" column="pft_price_id"/>
|
||||
|
||||
<collection property = "unavailableTimeList" javaType = "java.util.List" ofType = "ZdyTicketUnavailableTime"
|
||||
select = "selectZdyTicketUnavailableTimeByTicketId" column = "id"/>
|
||||
<collection property = "refundRuleList" javaType = "java.util.List" ofType = "ZdyTicketRefundRule"
|
||||
select = "selectZdyTicketRefundRuleByTicketId" column = "id"/>
|
||||
<collection property = "specialAreaList" javaType = "java.util.List" ofType = "ZdyTicketSpecialArea"
|
||||
select = "selectZdyTicketSpecialAreaByTicketId" column = "id"/>
|
||||
<collection property = "unavailableHolidayList" javaType = "java.util.List" ofType = "ZdyTicketUnavailableHoliday"
|
||||
select = "selectZdyTicketUnavailableHolidayByTicketId" column = "id"/>
|
||||
<collection property = "unavailableSpecialHolidayList" javaType = "java.util.List" ofType = "ZdyTicketUnavailableHoliday"
|
||||
select = "selectUnavailableSpecialHolidayByTicketId" column = "id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id = "ZdyTicketZdyTicketApplicablePeriodResult" type = "ZdyTicket" extends = "ZdyTicketResult">
|
||||
<collection property = "periodList"
|
||||
notNullColumn = "sub_id"
|
||||
javaType = "java.util.List"
|
||||
resultMap = "ZdyTicketApplicablePeriodResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketApplicablePeriod" id = "ZdyTicketApplicablePeriodResult">
|
||||
<result property = "id" column = "sub_id"/>
|
||||
<result property = "ticketId" column = "sub_ticket_id"/>
|
||||
<result property = "timeQuantum" column = "sub_time_quantum"/>
|
||||
<result property = "inventory" column = "sub_inventory"/>
|
||||
<result property = "price" column = "sub_price"/>
|
||||
<result property = "isInventory" column = "sub_is_inventory"/>
|
||||
<result property = "isPrice" column = "sub_is_price"/>
|
||||
<result property = "playTime" column = "sub_play_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketRefundRule" id = "ZdyTicketRefundRuleResult">
|
||||
<result property = "id" column = "sub_id"/>
|
||||
<result property = "ticketId" column = "sub_ticket_id"/>
|
||||
<result property = "day" column = "sub_day"/>
|
||||
<result property = "deductionFees" column = "sub_deduction_fees"/>
|
||||
<result property = "deductionFeesUnit" column = "sub_deduction_fees_unit"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketUnavailableTime" id = "ZdyTicketUnavailableTimeResult">
|
||||
<result property = "id" column = "time_id"/>
|
||||
<result property = "ticketId" column = "time_ticket_id"/>
|
||||
<result property = "beginTime" column = "time_begin_time"/>
|
||||
<result property = "endTime" column = "time_end_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketSpecialArea" id = "ZdyTicketSpecialAreaResult">
|
||||
<result property = "id" column = "area_id"/>
|
||||
<result property = "ticketId" column = "area_ticket_id"/>
|
||||
<result property = "provinceName" column = "area_province_name"/>
|
||||
<result property = "cityName" column = "area_city_name"/>
|
||||
<result property = "areaName" column = "area_area_name"/>
|
||||
<result property = "provinceCode" column = "area_province_code"/>
|
||||
<result property = "cityCode" column = "area_city_code"/>
|
||||
<result property = "areaCode" column = "area_area_code"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketUnavailableHoliday" id = "ZdyTicketUnavailableHolidayResult">
|
||||
<result property = "id" column = "holiday_id"/>
|
||||
<result property = "ticketId" column = "holiday_ticket_id"/>
|
||||
<result property = "holidayId" column = "holiday_holiday_id"/>
|
||||
<result property = "beginTime" column = "holiday_begin_time"/>
|
||||
<result property = "endTime" column = "holiday_end_time"/>
|
||||
<result property = "holidayName" column = "holiday_name"/>
|
||||
<result property = "holidayDict" column = "holiday_holiday_dict"/>
|
||||
<result property = "holidayType" column = "holiday_holiday_type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id = "selectZdyTicketUnavailableTimeByTicketId" parameterType = "Long" resultMap = "ZdyTicketUnavailableTimeResult">
|
||||
select id as time_id, ticket_id as time_ticket_id, begin_time as time_begin_time, end_time as time_end_time
|
||||
from zdy_ticket_unavailable_time
|
||||
where ticket_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketRefundRuleByTicketId" parameterType = "Long" resultMap = "ZdyTicketRefundRuleResult">
|
||||
select id as sub_id,
|
||||
ticket_id as sub_ticket_id,
|
||||
day as sub_day,
|
||||
deduction_fees as sub_deduction_fees,
|
||||
deduction_fees_unit as sub_deduction_fees_unit
|
||||
from zdy_ticket_refund_rule
|
||||
where ticket_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketUnavailableHolidayByTicketId" parameterType = "Long" resultMap = "ZdyTicketUnavailableHolidayResult">
|
||||
select ztuh.id as holiday_id,
|
||||
ztuh.holiday_id as holiday_holiday_id,
|
||||
ztuh.holiday_dict as holiday_holiday_dict,
|
||||
ztuh.holiday_type as holiday_holiday_type,
|
||||
sdd.dict_label as holiday_name
|
||||
from zdy_ticket_unavailable_holiday ztuh
|
||||
left join sys_dict_data sdd on ztuh.holiday_dict = sdd.dict_value and sdd.dict_type='holiday_type'
|
||||
where ztuh.ticket_id = #{id} and ztuh.holiday_type in ('1','2')
|
||||
</select>
|
||||
|
||||
<select id = "selectUnavailableSpecialHolidayByTicketId" parameterType = "Long" resultMap = "ZdyTicketUnavailableHolidayResult">
|
||||
select ztuh.id as holiday_id,
|
||||
ztuh.ticket_id as holiday_ticket_id,
|
||||
ztuh.holiday_id as holiday_holiday_id,
|
||||
ztuh.holiday_dict as holiday_holiday_dict,
|
||||
ztuh.begin_time as holiday_begin_time,
|
||||
ztuh.end_time as holiday_end_time,
|
||||
ztuh.holiday_type as holiday_holiday_type,
|
||||
zhv.holiday_name
|
||||
from zdy_ticket_unavailable_holiday ztuh
|
||||
left join zdy_holiday_vacations zhv on ztuh.holiday_id = zhv.id
|
||||
where ztuh.ticket_id = #{id} and ztuh.holiday_type ='3'
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketSpecialAreaByTicketId" parameterType = "Long" resultMap = "ZdyTicketSpecialAreaResult">
|
||||
select id as area_id,
|
||||
ticket_id as area_ticket_id,
|
||||
province_name as area_province_name,
|
||||
city_name as area_city_name,
|
||||
area_name as area_area_name,
|
||||
province_code as area_province_code,
|
||||
city_code as area_city_code,
|
||||
area_code as area_area_code
|
||||
from zdy_ticket_special_area
|
||||
where ticket_id = #{id}
|
||||
</select>
|
||||
|
||||
<sql id = "selectTicketVo">
|
||||
SELECT ti.id,
|
||||
ti.NAME,
|
||||
gr.scenic_id,
|
||||
ti.sales_rice,
|
||||
ti.price,
|
||||
ti.image,
|
||||
ti.classify,
|
||||
ti.grounding_flag,
|
||||
ti.create_time,
|
||||
ti.create_by,
|
||||
ti.update_time,
|
||||
ti.update_by,
|
||||
ti.remark,
|
||||
ti.del_flag,
|
||||
ti.inventory,
|
||||
ti.flag,
|
||||
ti.refund_rule,
|
||||
ti.is_fee,
|
||||
scenic.scenic_name,
|
||||
ti.is_order,
|
||||
ti.validity_start_time,
|
||||
ti.validity_end_time,
|
||||
ti.booking_notice,
|
||||
ti.group_id,
|
||||
ti.before_day,
|
||||
ti.is_order_quantity,
|
||||
ti.order_quantity,
|
||||
ti.authentication_type,
|
||||
ti.verify_settings,
|
||||
ti.is_delay,
|
||||
ti.is_unavailable_time,
|
||||
ti.delay_hour,
|
||||
ti.delay_minute,
|
||||
b.id AS sub_id,
|
||||
b.ticket_id AS sub_ticket_id,
|
||||
b.time_quantum AS sub_time_quantum,
|
||||
b.inventory AS sub_inventory,
|
||||
b.price AS sub_price,
|
||||
b.is_inventory as sub_is_inventory,
|
||||
b.is_price as sub_is_price,
|
||||
b.play_time as sub_play_time,
|
||||
ti.is_purchase_date,
|
||||
ti.purch_start_date,
|
||||
ti.purch_end_date,
|
||||
ti.ticket_validity_period,
|
||||
ti.buy_period_day,
|
||||
gr.NAME AS groupName,
|
||||
ti.classify,
|
||||
ti.admission_address,
|
||||
ti.admission_time,
|
||||
ti.sales,
|
||||
ti.image43,
|
||||
ti.image11,
|
||||
ti.fee_type,
|
||||
ti.deduction_fees,
|
||||
ti.deduction_fees_unit,
|
||||
ti.refund_day,
|
||||
ti.qrcode_rule,
|
||||
ti.is_refund_check,
|
||||
ti.is_reservation,
|
||||
ti.applicable_period,
|
||||
ti.sale_resource,
|
||||
ti.sort,
|
||||
ti.is_special,
|
||||
ti.special_type,
|
||||
ti.special_ticket,
|
||||
ti.year_old_start,
|
||||
ti.year_old_end,
|
||||
ti.sex,
|
||||
ti.special_area_ticket,
|
||||
ti.dept_id,
|
||||
ti.is_purchase_time,
|
||||
ti.purch_start_time,
|
||||
ti.purch_end_time,
|
||||
ti.is_unavailable_holiday,
|
||||
ti.limited_people,
|
||||
ti.ota_resource,
|
||||
ti.verification_mode,
|
||||
ti.active_mode,
|
||||
ti.is_limited_active,
|
||||
ti.limited_active_num,
|
||||
ti.tags,
|
||||
ti.purchase_reminder,
|
||||
ti.pft_ticket_flag,
|
||||
ti.pft_ticket_id,
|
||||
ti.pft_scenic_id,
|
||||
ti.pft_supplier_id
|
||||
FROM zdy_ticket ti
|
||||
LEFT JOIN zdy_ticket_applicable_period b ON b.ticket_id = ti.id
|
||||
LEFT JOIN zdy_ticket_group gr ON gr.id = ti.group_id
|
||||
LEFT JOIN zdy_scenic scenic ON scenic.id = gr.scenic_id
|
||||
</sql>
|
||||
|
||||
<sql id = "selectTicketPeriodVo">
|
||||
SELECT ti.id,
|
||||
ti.NAME,
|
||||
ti.scenic_id,
|
||||
ti.sales_rice,
|
||||
ti.price,
|
||||
ti.image,
|
||||
ti.classify,
|
||||
ti.grounding_flag,
|
||||
ti.create_time,
|
||||
ti.create_by,
|
||||
ti.update_time,
|
||||
ti.update_by,
|
||||
ti.remark,
|
||||
ti.del_flag,
|
||||
ti.inventory,
|
||||
ti.flag,
|
||||
ti.refund_rule,
|
||||
ti.is_fee,
|
||||
ti.is_order,
|
||||
ti.validity_start_time,
|
||||
ti.validity_end_time,
|
||||
ti.booking_notice,
|
||||
ti.group_id,
|
||||
ti.before_day,
|
||||
ti.is_order_quantity,
|
||||
ti.order_quantity,
|
||||
ti.authentication_type,
|
||||
ti.verify_settings,
|
||||
ti.is_purchase_date,
|
||||
ti.purch_start_date,
|
||||
ti.purch_end_date,
|
||||
ti.ticket_validity_period,
|
||||
ti.buy_period_day,
|
||||
ti.is_delay,
|
||||
ti.delay_hour,
|
||||
ti.delay_minute,
|
||||
ti.is_unavailable_time,
|
||||
ti.admission_address,
|
||||
ti.admission_time,
|
||||
ti.sales,
|
||||
ti.image43,
|
||||
ti.image11,
|
||||
ti.fee_type,
|
||||
ti.deduction_fees,
|
||||
ti.deduction_fees_unit,
|
||||
ti.refund_day,
|
||||
ti.qrcode_rule,
|
||||
ti.is_refund_check,
|
||||
ti.is_reservation,
|
||||
ti.applicable_period,
|
||||
ti.sale_resource,
|
||||
ti.sort,
|
||||
ti.is_special,
|
||||
ti.special_type,
|
||||
ti.special_ticket,
|
||||
ti.year_old_start,
|
||||
ti.year_old_end,
|
||||
ti.sex,
|
||||
ti.special_area_ticket,
|
||||
ti.dept_id,
|
||||
ti.is_purchase_time,
|
||||
ti.purch_start_time,
|
||||
ti.purch_end_time,
|
||||
ti.is_unavailable_holiday,
|
||||
ti.limited_people,
|
||||
ti.ota_resource,
|
||||
ti.agreement,
|
||||
ti.introduce,
|
||||
ti.child_restrictions,
|
||||
gr.name as groupName,
|
||||
sc.scenic_name,
|
||||
ti.verification_mode,
|
||||
ti.active_mode,
|
||||
ti.is_limited_active,
|
||||
ti.limited_active_num,
|
||||
ti.tags,
|
||||
ti.purchase_reminder,
|
||||
ti.ticket_supplier,
|
||||
ti.pft_ticket_id,
|
||||
ti.pft_scenic_id,
|
||||
ti.pft_supplier_id,
|
||||
ti.pft_price_id
|
||||
FROM zdy_ticket ti
|
||||
LEFT JOIN zdy_ticket_group gr ON gr.id = ti.group_id
|
||||
left join zdy_scenic sc on ti.scenic_id = sc.id
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyTicketList" parameterType = "ZdyTicket" resultMap = "ZdyTicketResult">
|
||||
<include refid = "selectTicketPeriodVo"/>
|
||||
left join sys_dept d on d.dept_id = ti.dept_id
|
||||
<where>
|
||||
ti.del_flag = 0
|
||||
<if test = "ids != null and ids.size() != 0">
|
||||
and ti.id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test = "name != null and name != ''">
|
||||
and ti.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test = "groundingFlag != null">
|
||||
and ti.grounding_flag = #{groundingFlag}
|
||||
</if>
|
||||
<choose>
|
||||
<when test = "classifyArray != null and classifyArray.length != 0">
|
||||
and ti.classify in
|
||||
<foreach item = "item" collection = "classifyArray" open = "(" separator = "," close = ")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test = "classify != null and classify != ''">
|
||||
and ti.classify = #{classify}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test = "groupId != null">
|
||||
and ti.group_id = #{groupId}
|
||||
</if>
|
||||
<if test = "flag != null and flag != ''">
|
||||
and ti.flag like concat('%', #{flag}, '%')
|
||||
</if>
|
||||
<if test = "isReservation != null">
|
||||
and ti.is_reservation = #{isReservation}
|
||||
</if>
|
||||
<if test = "saleResource != null">
|
||||
AND FIND_IN_SET( #{saleResource}, ti.sale_resource)
|
||||
</if>
|
||||
<if test = "scenicId != null">
|
||||
and ti.scenic_id = #{scenicId}
|
||||
</if>
|
||||
<if test="playTime !=null">
|
||||
and (
|
||||
CASE WHEN ti.validity_end_time IS NOT NULL
|
||||
THEN #{playTime} <= ti.validity_end_time
|
||||
ELSE true END
|
||||
)
|
||||
</if>
|
||||
<if test = "params.buyTime!=null">
|
||||
and (ti.is_purchase_date = 0 or
|
||||
(ti.purch_start_date <= DATE_FORMAT(#{params.buyTime}, '%Y-%m-%d %H:%i:%s')
|
||||
and ti.purch_end_date >= DATE_FORMAT(#{params.buyTime}, '%Y-%m-%d %H:%i:%s')))
|
||||
</if>
|
||||
<if test="ticketSupplier !=null">
|
||||
and ti.ticket_supplier = #{ticketSupplier}
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
order by ti.id desc
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketById" parameterType = "Long" resultMap = "ZdyTicketResult">
|
||||
<include refid = "selectTicketPeriodVo"/>
|
||||
where ti.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyTicket" parameterType = "ZdyTicket" useGeneratedKeys = "true" keyProperty = "id">
|
||||
insert into zdy_ticket
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "name != null and name != ''">name,</if>
|
||||
<if test = "scenicId != null">scenic_id,</if>
|
||||
<if test = "salesRice != null">sales_rice,</if>
|
||||
<if test = "price != null">price,</if>
|
||||
<if test = "image != null">image,</if>
|
||||
<if test = "classify != null">classify,</if>
|
||||
<if test = "groundingFlag != null">grounding_flag,</if>
|
||||
<if test = "createTime != null">create_time,</if>
|
||||
<if test = "createBy != null">create_by,</if>
|
||||
<if test = "updateTime != null">update_time,</if>
|
||||
<if test = "updateBy != null">update_by,</if>
|
||||
<if test = "remark != null">remark,</if>
|
||||
<if test = "delFlag != null">del_flag,</if>
|
||||
<if test = "inventory != null">inventory,</if>
|
||||
<if test = "flag != null">flag,</if>
|
||||
<if test = "refundRule != null">refund_rule,</if>
|
||||
<if test = "isFee != null">is_fee,</if>
|
||||
<if test = "isOrder != null">is_order,</if>
|
||||
<if test = "validityStartTime != null">validity_start_time,</if>
|
||||
<if test = "validityEndTime != null">validity_end_time,</if>
|
||||
<if test = "bookingNotice != null">booking_notice,</if>
|
||||
<if test = "groupId != null">group_id,</if>
|
||||
<if test = "beforeDay != null">before_day,</if>
|
||||
<if test = "isOrderQuantity != null">is_order_quantity,</if>
|
||||
<if test = "orderQuantity != null">order_quantity,</if>
|
||||
<if test = "authenticationType != null">authentication_type,</if>
|
||||
<if test = "verifySettings != null">verify_settings,</if>
|
||||
<if test = "isPurchaseDate != null">is_purchase_date,</if>
|
||||
<if test = "purchStartDate != null">purch_start_date,</if>
|
||||
<if test = "purchEndDate != null">purch_end_date,</if>
|
||||
<if test = "ticketValidityPeriod != null">ticket_validity_period,</if>
|
||||
<if test = "buyPeriodDay != null">buy_period_day,</if>
|
||||
<if test = "admissionTime != null">admission_time,</if>
|
||||
<if test = "admissionAddress != null">admission_address,</if>
|
||||
<if test = "sales != null">sales,</if>
|
||||
<if test = "image11 != null">image11,</if>
|
||||
<if test = "image43 != null">image43,</if>
|
||||
<if test = "feeType != null">fee_type,</if>
|
||||
<if test = "deductionFees != null">deduction_fees,</if>
|
||||
<if test = "deductionFeesUnit != null">deduction_fees_unit,</if>
|
||||
<if test = "refundDay != null">refund_day,</if>
|
||||
<if test = "qrcodeRule != null">qrcode_rule,</if>
|
||||
<if test = "isRefundCheck != null">is_refund_check,</if>
|
||||
<if test = "isReservation != null">is_reservation,</if>
|
||||
<if test = "applicablePeriod != null">applicable_period,</if>
|
||||
<if test = "sort != null">sort,</if>
|
||||
<if test = "saleResource != null">sale_resource,</if>
|
||||
<if test = "isDelay != null">is_delay,</if>
|
||||
<if test = "delayHour != null">delay_hour,</if>
|
||||
<if test = "delayMinute != null">delay_minute,</if>
|
||||
<if test = "isUnavailableTime != null">is_unavailable_time,</if>
|
||||
<if test = "isSpecial != null">is_special,</if>
|
||||
<if test = "specialType != null">special_type,</if>
|
||||
<if test = "specialTicket != null">special_ticket,</if>
|
||||
<if test = "yearOldStart != null">year_old_start,</if>
|
||||
<if test = "yearOldEnd != null">year_old_end,</if>
|
||||
<if test = "sex != null">sex,</if>
|
||||
<if test = "specialAreaTicket != null">special_area_ticket,</if>
|
||||
<if test = "deptId != null">dept_id,</if>
|
||||
<if test = "isPurchaseTime != null">is_purchase_time,</if>
|
||||
<if test = "purchStartTime != null">purch_start_time,</if>
|
||||
<if test = "purchEndTime != null">purch_end_time,</if>
|
||||
<if test = "isUnavailableHoliday != null">is_unavailable_holiday,</if>
|
||||
<if test = "limitedPeople != null">limited_people,</if>
|
||||
<if test = "otaResource != null">ota_resource,</if>
|
||||
<if test = "agreement != null">agreement,</if>
|
||||
<if test = "introduce != null">introduce,</if>
|
||||
<if test = "childRestrictions != null">child_restrictions,</if>
|
||||
<if test = "verificationMode != null">verification_mode,</if>
|
||||
<if test = "activeMode != null">active_mode,</if>
|
||||
<if test = "isLimitedActive != null">is_limited_active,</if>
|
||||
<if test = "limitedActiveNum != null">limited_active_num,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="purchaseReminder != null and purchaseReminder != ''">purchase_reminder,</if>
|
||||
<if test="ticketSupplier !=null and ticketSupplier !=''">ticket_supplier, </if>
|
||||
<if test="pftTicketId !=null and pftTicketId !=''">pft_ticket_id,</if>
|
||||
<if test="pftScenicId !=null and pftScenicId !=''">pft_scenic_id,</if>
|
||||
<if test="pftSupplierId !=null and pftSupplierId !=''"> pft_supplier_id,</if>
|
||||
<if test="pftPriceId !=null">pft_price_id,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "name != null and name != ''">#{name},</if>
|
||||
<if test = "scenicId!= null">#{scenicId},</if>
|
||||
<if test = "salesRice != null">#{salesRice},</if>
|
||||
<if test = "price != null">#{price},</if>
|
||||
<if test = "image != null">#{image},</if>
|
||||
<if test = "classify != null">#{classify},</if>
|
||||
<if test = "groundingFlag != null">#{groundingFlag},</if>
|
||||
<if test = "createTime != null">#{createTime},</if>
|
||||
<if test = "createBy != null">#{createBy},</if>
|
||||
<if test = "updateTime != null">#{updateTime},</if>
|
||||
<if test = "updateBy != null">#{updateBy},</if>
|
||||
<if test = "remark != null">#{remark},</if>
|
||||
<if test = "delFlag != null">#{delFlag},</if>
|
||||
<if test = "inventory != null">#{inventory},</if>
|
||||
<if test = "flag != null">#{flag},</if>
|
||||
<if test = "refundRule != null">#{refundRule},</if>
|
||||
<if test = "isFee != null">#{isFee},</if>
|
||||
<if test = "isOrder != null">#{isOrder},</if>
|
||||
<if test = "validityStartTime != null">#{validityStartTime},</if>
|
||||
<if test = "validityEndTime != null">#{validityEndTime},</if>
|
||||
<if test = "bookingNotice != null">#{bookingNotice},</if>
|
||||
<if test = "groupId != null">#{groupId},</if>
|
||||
<if test = "beforeDay != null">#{beforeDay},</if>
|
||||
<if test = "isOrderQuantity != null">#{isOrderQuantity},</if>
|
||||
<if test = "orderQuantity != null">#{orderQuantity},</if>
|
||||
<if test = "authenticationType != null">#{authenticationType},</if>
|
||||
<if test = "verifySettings != null">#{verifySettings},</if>
|
||||
<if test = "isPurchaseDate != null">#{isPurchaseDate},</if>
|
||||
<if test = "purchStartDate != null">#{purchStartDate},</if>
|
||||
<if test = "purchEndDate != null">#{purchEndDate},</if>
|
||||
<if test = "ticketValidityPeriod != null">#{ticketValidityPeriod},</if>
|
||||
<if test = "buyPeriodDay != null">#{buyPeriodDay},</if>
|
||||
<if test = "admissionTime != null">#{admissionTime},</if>
|
||||
<if test = "admissionAddress != null">#{admissionAddress},</if>
|
||||
<if test = "sales != null">#{sales},</if>
|
||||
<if test = "image11 != null">#{image11},</if>
|
||||
<if test = "image43 != null">#{image43},</if>
|
||||
<if test = "feeType != null">#{feeType},</if>
|
||||
<if test = "deductionFees != null">#{deductionFees},</if>
|
||||
<if test = "deductionFeesUnit != null">#{deductionFeesUnit},</if>
|
||||
<if test = "refundDay != null">#{refundDay},</if>
|
||||
<if test = "qrcodeRule != null">#{qrcodeRule},</if>
|
||||
<if test = "isRefundCheck != null">#{isRefundCheck},</if>
|
||||
<if test = "isReservation != null">#{isReservation},</if>
|
||||
<if test = "applicablePeriod != null">#{applicablePeriod},</if>
|
||||
<if test = "sort != null">#{sort},</if>
|
||||
<if test = "saleResource != null">#{saleResource},</if>
|
||||
<if test = "isDelay != null">#{isDelay},</if>
|
||||
<if test = "delayHour != null">#{delayHour},</if>
|
||||
<if test = "delayMinute != null">#{delayMinute},</if>
|
||||
<if test = "isUnavailableTime != null">#{isUnavailableTime},</if>
|
||||
<if test = "isSpecial != null">#{isSpecial},</if>
|
||||
<if test = "specialType != null">#{specialType},</if>
|
||||
<if test = "specialTicket != null">#{specialTicket},</if>
|
||||
<if test = "yearOldStart != null">#{yearOldStart},</if>
|
||||
<if test = "yearOldEnd != null">#{yearOldEnd},</if>
|
||||
<if test = "sex != null">#{sex},</if>
|
||||
<if test = "specialAreaTicket != null">#{specialAreaTicket},</if>
|
||||
<if test = "deptId != null">#{deptId},</if>
|
||||
<if test = "isPurchaseTime != null">#{isPurchaseTime},</if>
|
||||
<if test = "purchStartTime != null">#{purchStartTime},</if>
|
||||
<if test = "purchEndTime != null">#{purchEndTime},</if>
|
||||
<if test = "isUnavailableHoliday != null">#{isUnavailableHoliday},</if>
|
||||
<if test = "limitedPeople != null">#{limitedPeople},</if>
|
||||
<if test = "otaResource != null">#{otaResource},</if>
|
||||
<if test = "agreement != null">#{agreement},</if>
|
||||
<if test = "introduce != null">#{introduce},</if>
|
||||
<if test = "childRestrictions != null">#{childRestrictions},</if>
|
||||
<if test = "verificationMode != null">#{verificationMode},</if>
|
||||
<if test = "activeMode != null">#{activeMode},</if>
|
||||
<if test = "isLimitedActive != null">#{isLimitedActive},</if>
|
||||
<if test = "limitedActiveNum != null">#{limitedActiveNum},</if>
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="purchaseReminder != null and purchaseReminder != ''">#{purchaseReminder},</if>
|
||||
<if test="ticketSupplier !=null and ticketSupplier !=''">#{ticketSupplier}, </if>
|
||||
<if test="pftTicketId !=null and pftTicketId !=''">#{pftTicketId},</if>
|
||||
<if test="pftScenicId !=null and pftScenicId !=''">#{pftScenicId},</if>
|
||||
<if test="pftSupplierId !=null and pftSupplierId !=''"> #{pftSupplierId},</if>
|
||||
<if test="pftPriceId !=null">#{pftPriceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyTicket" parameterType = "ZdyTicket">
|
||||
update zdy_ticket
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "name != null and name != ''">name = #{name},</if>
|
||||
<if test = "scenicId != null">scenic_id = #{scenicId},</if>
|
||||
<if test = "salesRice != null">sales_rice = #{salesRice},</if>
|
||||
<if test = "price != null">price = #{price},</if>
|
||||
<if test = "image != null">image = #{image},</if>
|
||||
<if test = "classify != null">classify = #{classify},</if>
|
||||
<if test = "groundingFlag != null">grounding_flag = #{groundingFlag},</if>
|
||||
<if test = "createTime != null">create_time = #{createTime},</if>
|
||||
<if test = "createBy != null">create_by = #{createBy},</if>
|
||||
<if test = "updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test = "updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test = "remark != null">remark = #{remark},</if>
|
||||
<if test = "delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test = "inventory != null">inventory = #{inventory},</if>
|
||||
flag = #{flag},
|
||||
<if test = "refundRule != null and refundRule !='' ">refund_rule = #{refundRule},</if>
|
||||
<if test = "isFee != null">is_fee = #{isFee},</if>
|
||||
<if test = "isOrder != null">is_order = #{isOrder},</if>
|
||||
<if test = "validityStartTime != null">validity_start_time = #{validityStartTime},</if>
|
||||
<if test = "validityEndTime != null">validity_end_time = #{validityEndTime},</if>
|
||||
<if test = "bookingNotice != null and bookingNotice !='' ">booking_notice = #{bookingNotice},</if>
|
||||
<if test = "groupId != null">group_id = #{groupId},</if>
|
||||
<if test = "beforeDay != null">before_day = #{beforeDay},</if>
|
||||
<if test = "isOrderQuantity != null">is_order_quantity = #{isOrderQuantity},</if>
|
||||
<if test = "orderQuantity != null">order_quantity = #{orderQuantity},</if>
|
||||
<if test = "authenticationType != null">authentication_type = #{authenticationType},</if>
|
||||
<if test = "verifySettings != null">verify_settings = #{verifySettings},</if>
|
||||
<if test = "isPurchaseDate != null">is_purchase_date = #{isPurchaseDate},</if>
|
||||
<if test = "purchStartDate != null">purch_start_date = #{purchStartDate},</if>
|
||||
<if test = "purchEndDate != null">purch_end_date = #{purchEndDate},</if>
|
||||
<if test = "ticketValidityPeriod != null">ticket_validity_period = #{ticketValidityPeriod},</if>
|
||||
<if test = "buyPeriodDay != null">buy_period_day = #{buyPeriodDay},</if>
|
||||
<if test = "admissionAddress != null">admission_address = #{admissionAddress},</if>
|
||||
<if test = "admissionTime != null">admission_time = #{admissionTime},</if>
|
||||
<if test = "sales != null">sales = #{sales},</if>
|
||||
<if test = "image11 != null">image11 = #{image11},</if>
|
||||
<if test = "image43 != null">image43 = #{image43},</if>
|
||||
<if test = "feeType != null">fee_type = #{feeType},</if>
|
||||
<if test = "deductionFees != null">deduction_fees = #{deductionFees},</if>
|
||||
<if test = "deductionFeesUnit != null">deduction_fees_unit = #{deductionFeesUnit},</if>
|
||||
<if test = "refundDay != null">refund_day = #{refundDay},</if>
|
||||
<if test = "qrcodeRule != null">qrcode_rule = #{qrcodeRule},</if>
|
||||
<if test = "isRefundCheck != null">is_refund_check = #{isRefundCheck},</if>
|
||||
<if test = "isReservation != null">is_reservation = #{isReservation},</if>
|
||||
<if test = "applicablePeriod != null">applicable_period = #{applicablePeriod},</if>
|
||||
<if test = "sort != null">sort = #{sort},</if>
|
||||
<if test = "saleResource != null">sale_resource = #{saleResource},</if>
|
||||
<if test = "isDelay != null">is_delay =#{isDelay},</if>
|
||||
<if test = "delayHour != null">delay_hour =#{delayHour},</if>
|
||||
<if test = "delayMinute != null">delay_minute =#{delayMinute},</if>
|
||||
<if test = "isUnavailableTime != null">is_unavailable_time =#{isUnavailableTime},</if>
|
||||
<if test = "isSpecial != null">is_special =#{isSpecial},</if>
|
||||
<if test = "specialType != null">special_type =#{specialType},</if>
|
||||
<if test = "specialTicket != null">special_ticket =#{specialTicket},</if>
|
||||
<if test = "yearOldStart != null">year_old_start =#{yearOldStart},</if>
|
||||
<if test = "yearOldEnd != null">year_old_end =#{yearOldEnd},</if>
|
||||
<if test = "sex != null">sex =#{sex},</if>
|
||||
<if test = "specialAreaTicket != null">special_area_ticket =#{specialAreaTicket},</if>
|
||||
<if test = "deptId != null">dept_id =#{deptId},</if>
|
||||
<if test = "isPurchaseTime != null">is_purchase_time =#{isPurchaseTime},</if>
|
||||
<if test = "purchStartTime != null">purch_start_time =#{purchStartTime},</if>
|
||||
<if test = "purchEndTime != null">purch_end_time =#{purchEndTime},</if>
|
||||
<if test = "isUnavailableHoliday != null">is_unavailable_holiday =#{isUnavailableHoliday},</if>
|
||||
<if test = "limitedPeople != null">limited_people =#{limitedPeople},</if>
|
||||
<if test = "otaResource != null">ota_resource =#{otaResource},</if>
|
||||
<if test = "agreement != null">agreement =#{agreement},</if>
|
||||
<if test = "introduce != null">introduce =#{introduce},</if>
|
||||
<if test = "childRestrictions != null">child_restrictions = #{childRestrictions},</if>
|
||||
<if test = "verificationMode != null">verification_mode = #{verificationMode},</if>
|
||||
<if test = "activeMode != null">active_mode = #{activeMode},</if>
|
||||
<if test = "isLimitedActive != null">is_limited_active = #{isLimitedActive},</if>
|
||||
<if test = "limitedActiveNum != null">limited_active_num = #{limitedActiveNum},</if>
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="purchaseReminder != null and purchaseReminder != ''">purchase_reminder = #{purchaseReminder},</if>
|
||||
<if test="ticketSupplier !=null and ticketSupplier !=''">ticket_supplier = #{ticketSupplier}, </if>
|
||||
<if test="pftTicketId !=null">pft_ticket_id = #{pftTicketId},</if>
|
||||
<if test="pftScenicId !=null">pft_scenic_id = #{pftScenicId},</if>
|
||||
<if test="pftSupplierId !=null"> pft_supplier_id = #{pftSupplierId},</if>
|
||||
<if test="pftPriceId !=null"> pft_price_id = #{pftPriceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyTicketById" parameterType = "Long">
|
||||
update zdy_ticket
|
||||
set del_flag = 1
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyTicketByIds" parameterType = "String">
|
||||
update zdy_ticket set del_flag = 1 where id in
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id = "selectZdyTicketByScenicId" parameterType = "ZdyTicket" resultMap = "ZdyTicketResult">
|
||||
SELECT t.id, t.NAME, t.scenic_id, t.sales_rice, t.price, t.image, t.grounding_flag, t.inventory, t.flag,
|
||||
t.refund_rule, t.is_order, t.validity_start_time, t.validity_end_time, t.classify, t.before_day,
|
||||
t.is_order_quantity, t.order_quantity, t.authentication_type, t.verify_settings, t.booking_notice,
|
||||
t.admission_address, t.admission_time, t.sales, t.is_purchase_date, t.purch_start_date, t.purch_end_date,
|
||||
t.image43, t.image11, t.refund_day, t.fee_type, t.deduction_fees, t.deduction_fees_unit, t.qrcode_rule,
|
||||
sc.adjust, gr.name as groupName, t.group_id, t.is_reservation, t.applicable_period, t.sort, t.sale_resource,
|
||||
t.is_delay, t.delay_hour, t.delay_minute, t.is_unavailable_time, t.dept_id, t.is_special,
|
||||
t.special_type, t.special_ticket, t.year_old_start, t.year_old_end, t.sex, t.special_area_ticket,
|
||||
t.is_purchase_time, t.purch_start_time, t.purch_end_time, t.is_unavailable_holiday, t.limited_people,
|
||||
t.ota_resource,t.verification_mode,t.active_mode,t.is_limited_active, t.limited_active_num,t.tags,t.purchase_reminder,
|
||||
t.ticket_supplier,t.pft_ticket_id,t.pft_scenic_id,t.pft_supplier_id,
|
||||
sc.scenic_name
|
||||
FROM zdy_ticket t LEFT JOIN zdy_ticket_group gr ON gr.id = t.group_id LEFT JOIN zdy_scenic sc ON
|
||||
sc.id = gr.scenic_id
|
||||
WHERE t.del_flag = 0 AND t.grounding_flag = 1 and t.classify !='6'
|
||||
and (CASE WHEN t.validity_end_time IS NOT NULL THEN sysdate() <= t.validity_end_time ELSE true END)
|
||||
<if test="scenicId != null and scenicId != ''">
|
||||
and t.scenic_id = #{scenicId}
|
||||
</if>
|
||||
<if test="flag != null and flag != ''">
|
||||
AND FIND_IN_SET( #{flag}, t.flag)
|
||||
</if>
|
||||
<if test="saleResource != null and saleResource != ''">
|
||||
AND FIND_IN_SET( #{saleResource}, t.sale_resource)
|
||||
</if>
|
||||
<if test="authenticationType != null and authenticationType != ''">
|
||||
AND t.authentication_type = #{authenticationType}
|
||||
</if>
|
||||
order by sort
|
||||
</select>
|
||||
|
||||
<select id = "selectCountByScenicId" parameterType = "Long" resultType = "decimal">
|
||||
SELECT IFNULL(min(ti.sales_rice), 0) AS minPrice
|
||||
FROM zdy_ticket ti
|
||||
LEFT JOIN zdy_ticket_group gr ON gr.id = ti.group_id
|
||||
WHERE gr.scenic_id = #{scenicId}
|
||||
AND ti.del_flag = 0
|
||||
AND ti.grounding_flag = 1
|
||||
</select>
|
||||
|
||||
<select id = "existsTicketNameWithGroupId" resultType = "java.lang.Integer">
|
||||
SELECT EXISTS(SELECT 1 FROM zdy_ticket WHERE del_flag = 0 and group_id = #{groupId} and name = #{name}
|
||||
<if test = "id != null">
|
||||
and id != #{id}
|
||||
</if>)
|
||||
</select>
|
||||
|
||||
<select id = "hasTicketsInGroup" parameterType = "java.lang.Long" resultType = "java.lang.Long">
|
||||
SELECT DISTINCT(group_id) FROM zdy_ticket WHERE del_flag = 0 AND group_id IN
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id = "selectTicketByIds" resultType = "map" parameterType = "String">
|
||||
SELECT ti.id , ti.`name` as ticketName, ti.image, ti.image11, ti.image43, ti.booking_notice as bookingNotice,
|
||||
ti.sales_rice AS salesRice, ti.classify, ti.refund_rule as refundRule, ti.refund_day as refundDay,
|
||||
ti.qrcode_rule as qrcodeRule FROM zdy_ticket ti WHERE ti.del_flag = '0' AND ti.id IN
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by ti.id desc
|
||||
</select>
|
||||
|
||||
<update id = "updateZdyTicketSales" parameterType = "com.zhwl.ticket.domain.dto.TicketSalesDTO">
|
||||
update zdy_ticket set sales = sales + #{sales}
|
||||
<if test = "inventory != null">
|
||||
,inventory = inventory - #{inventory}
|
||||
</if>
|
||||
where id = #{ticketId}
|
||||
</update>
|
||||
|
||||
<!--查询是否已关联套票-->
|
||||
<select id = "queryIsLinkTicket" parameterType = "Long" resultType = "Boolean">
|
||||
SELECT EXISTS
|
||||
(SELECT ticket_id
|
||||
FROM zdy_ticket_child
|
||||
WHERE child_ticket_id = #{ticketId})
|
||||
</select>
|
||||
|
||||
<select id = "listNamesByIds" resultMap = "ZdyTicketResult">
|
||||
select id, name from zdy_ticket where id in
|
||||
<foreach item = "id" collection = "list" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyTicketListByScenicId" parameterType = "long" resultMap = "ZdyTicketResult">
|
||||
select id, name,grounding_flag,pft_ticket_id
|
||||
from zdy_ticket
|
||||
where scenic_id = #{scenicId}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id = "selectTicketListByIds" resultMap = "ZdyTicketResult">
|
||||
select * from zdy_ticket
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test = "ids != null and ids.size() != 0">
|
||||
and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id = "getCouponTicketList" parameterType = "ZdyTicket" resultMap = "ZdyTicketResult">
|
||||
<include refid = "selectTicketPeriodVo"/>
|
||||
left join sys_dept d on d.dept_id = ti.dept_id
|
||||
LEFT JOIN sys_user_role sur on sur.user_id=ti.create_by
|
||||
LEFT JOIN sys_role sr on sur.role_id=sr.role_id
|
||||
<where>
|
||||
ti.del_flag = 0 and (CASE WHEN validity_end_time IS NOT NULL THEN sysdate()
|
||||
<= validity_end_time ELSE true END)
|
||||
and sr.role_key='yyAdmin'
|
||||
<choose>
|
||||
<when test = "classifyArray != null and classifyArray.length != 0">
|
||||
and ti.classify in
|
||||
<foreach item = "item" collection = "classifyArray" open = "(" separator = "," close = ")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test = "classify != null and classify != ''">
|
||||
and ti.classify = #{classify}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="name != null and name != ''">
|
||||
and ti.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
and ti.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="scenicId != null">
|
||||
and ti.scenic_id = #{scenicId}
|
||||
</if>
|
||||
${params.dataScope}
|
||||
group by ti.id
|
||||
</where>
|
||||
order by ti.id desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryNearScenicRecommendTicket" parameterType="ZdyTicket" resultMap = "ZdyTicketResult">
|
||||
select t.*, ROUND(ST_DISTANCE_SPHERE(
|
||||
POINT(substr(s.coordinate, 1, instr(s.coordinate, ',') - 1),
|
||||
substr(s.coordinate, instr(s.coordinate, ',') + 1)),
|
||||
POINT(#{params.longitude}, #{params.latitude})) / 1000, 2) distance
|
||||
from zdy_ticket t
|
||||
left join zdy_scenic s on t.scenic_id = s.id
|
||||
where t.del_flag = '0'
|
||||
order by ISNULL(distance),distance
|
||||
</select>
|
||||
<select id="selectByIdForUpdate" resultMap = "ZdyTicketResult">
|
||||
select * from zdy_ticket where id in
|
||||
<foreach collection="list" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
for update
|
||||
</select>
|
||||
<update id = "updateZdyTicketGroupingFlag" parameterType = "ZdyTicket">
|
||||
update zdy_ticket set grounding_flag = #{groundingFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="listTicketsByChildDataScope" parameterType="ZdyTicket" resultMap="ZdyTicketResult">
|
||||
SELECT id,
|
||||
`name`
|
||||
FROM zdy_ticket zt
|
||||
LEFT JOIN (SELECT DISTINCT ticket_id
|
||||
FROM zdy_ticket_child ztc_tmp
|
||||
LEFT JOIN zdy_ticket zt_tmp on zt_tmp.id = ztc_tmp.child_ticket_id
|
||||
<where>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
) ztc on ztc.ticket_id = zt.id
|
||||
<where>
|
||||
classify = #{classify}
|
||||
AND del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByPftTicketId" resultMap="ZdyTicketResult">
|
||||
select * from zdy_ticket where pft_ticket_id = #{pftTicketId} and del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,115 @@
|
||||
<?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.ticket.mapper.ZdyTicketOtaLogMapper">
|
||||
|
||||
<resultMap type="ZdyTicketOtaLog" id="ZdyTicketOtaLogResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="otaTicketId" column="ota_ticket_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="opinion" column="opinion"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketOtaLogVo">
|
||||
select id, ota_ticket_id, status, opinion, create_time, create_by
|
||||
from zdy_ticket_ota_log
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketOtaLogList" parameterType="ZdyTicketOtaLog" resultMap="ZdyTicketOtaLogResult">
|
||||
<include refid="selectZdyTicketOtaLogVo"/>
|
||||
<where>
|
||||
<if test="otaTicketId != null ">
|
||||
and ota_ticket_id = #{otaTicketId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="opinion != null and opinion != ''">
|
||||
and opinion = #{opinion}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketOtaLogById" parameterType="Long"
|
||||
resultMap="ZdyTicketOtaLogResult">
|
||||
<include refid="selectZdyTicketOtaLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketOtaLog" parameterType="ZdyTicketOtaLog">
|
||||
insert into zdy_ticket_ota_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,
|
||||
</if>
|
||||
<if test="otaTicketId != null">ota_ticket_id,
|
||||
</if>
|
||||
<if test="status != null">status,
|
||||
</if>
|
||||
<if test="opinion != null">opinion,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},
|
||||
</if>
|
||||
<if test="otaTicketId != null">#{otaTicketId},
|
||||
</if>
|
||||
<if test="status != null">#{status},
|
||||
</if>
|
||||
<if test="opinion != null">#{opinion},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketOtaLog" parameterType="ZdyTicketOtaLog">
|
||||
update zdy_ticket_ota_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="otaTicketId != null">ota_ticket_id =
|
||||
#{otaTicketId},
|
||||
</if>
|
||||
<if test="status != null">status =
|
||||
#{status},
|
||||
</if>
|
||||
<if test="opinion != null">opinion =
|
||||
#{opinion},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketOtaLogById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_ota_log
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketOtaLogByIds" parameterType="String">
|
||||
delete from zdy_ticket_ota_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteZdyTicketOtaLogByOtaTicketIds" parameterType="String">
|
||||
delete from zdy_ticket_ota_log where ota_ticket_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,172 @@
|
||||
<?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.ticket.mapper.ZdyTicketOtaMapper">
|
||||
|
||||
<resultMap type="ZdyTicketOta" id="ZdyTicketOtaResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="channelType" column="channel_type"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="opinion" column="opinion"/>
|
||||
<result property="statusTime" column="status_time"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="settlementPrice" column="settlement_price"/>
|
||||
<result property="descr" column="descr"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
<resultMap type="zdyTicketOtaVo" id="ZdyTicketOtaResultVo" extends="ZdyTicketOtaResult">
|
||||
<result property="price" column="ticket_id"/>
|
||||
<result property="salesRice" column="ticket_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketOtaVo">
|
||||
select id,
|
||||
channel_type,
|
||||
ticket_id,
|
||||
opinion,
|
||||
status_time,
|
||||
status,
|
||||
settlement_price,
|
||||
descr,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by
|
||||
from zdy_ticket_ota
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketOtaList" parameterType="ZdyTicketOta" resultMap="ZdyTicketOtaResultVo">
|
||||
<include refid="selectZdyTicketOtaVo"/>
|
||||
<where>
|
||||
<if test="channelType != null and channelType != ''">
|
||||
and channel_type = #{channelType}
|
||||
</if>
|
||||
<if test="ticketId != null ">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketOtaById" parameterType="Long"
|
||||
resultMap="ZdyTicketOtaResult">
|
||||
<include refid="selectZdyTicketOtaVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectZdyTicketOtaByTicketId" resultMap="ZdyTicketOtaResult">
|
||||
<include refid="selectZdyTicketOtaVo"/>
|
||||
where ticket_id = #{ticketId} and channel_type = #{channelType} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketOta" parameterType="ZdyTicketOta" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_ota
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="channelType != null and channelType != ''">channel_type,
|
||||
</if>
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
<if test="opinion != null">opinion,
|
||||
</if>
|
||||
<if test="statusTime != null">status_time,
|
||||
</if>
|
||||
<if test="status != null">status,
|
||||
</if>
|
||||
<if test="settlementPrice != null">settlement_price,
|
||||
</if>
|
||||
<if test="descr != null">descr,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="channelType != null and channelType != ''">#{channelType},
|
||||
</if>
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
<if test="opinion != null">#{opinion},
|
||||
</if>
|
||||
<if test="statusTime != null">#{statusTime},
|
||||
</if>
|
||||
<if test="status != null">#{status},
|
||||
</if>
|
||||
<if test="settlementPrice != null">#{settlementPrice},
|
||||
</if>
|
||||
<if test="descr != null">#{descr},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketOta" parameterType="ZdyTicketOta">
|
||||
update zdy_ticket_ota
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="channelType != null and channelType != ''">channel_type =
|
||||
#{channelType},
|
||||
</if>
|
||||
<if test="ticketId != null">ticket_id =
|
||||
#{ticketId},
|
||||
</if>
|
||||
<if test="opinion != null">opinion =
|
||||
#{opinion},
|
||||
</if>
|
||||
<if test="statusTime != null">status_time =
|
||||
#{statusTime},
|
||||
</if>
|
||||
<if test="status != null">status =
|
||||
#{status},
|
||||
</if>
|
||||
<if test="settlementPrice != null">settlement_price =
|
||||
#{settlementPrice},
|
||||
</if>
|
||||
<if test="descr != null">descr =
|
||||
#{descr},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketOtaById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_ota
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketOtaByIds" parameterType="String">
|
||||
delete from zdy_ticket_ota where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,106 @@
|
||||
<?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.ticket.mapper.ZdyTicketRefundRuleMapper">
|
||||
|
||||
<resultMap type="ZdyTicketRefundRule" id="ZdyTicketRefundRuleResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="day" column="day"/>
|
||||
<result property="deductionFees" column="deduction_fees"/>
|
||||
<result property="deductionFeesUnit" column="deduction_fees_unit"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketRefundRuleVo">
|
||||
select id, ticket_id, day, deduction_fees, deduction_fees_unit
|
||||
from zdy_ticket_refund_rule
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketRefundRuleList" parameterType="ZdyTicketRefundRule"
|
||||
resultMap="ZdyTicketRefundRuleResult">
|
||||
<include refid="selectZdyTicketRefundRuleVo"/>
|
||||
<where>
|
||||
<if test="ticketId != null ">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test="day != null ">
|
||||
and day = #{day}
|
||||
</if>
|
||||
<if test="deductionFees != null ">
|
||||
and deduction_fees = #{deductionFees}
|
||||
</if>
|
||||
<if test="deductionFeesUnit != null and deductionFeesUnit != ''">
|
||||
and deduction_fees_unit = #{deductionFeesUnit}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketRefundRuleById" parameterType="Long"
|
||||
resultMap="ZdyTicketRefundRuleResult">
|
||||
<include refid="selectZdyTicketRefundRuleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketRefundRule" parameterType="ZdyTicketRefundRule" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_refund_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
<if test="day != null">day,
|
||||
</if>
|
||||
<if test="deductionFees != null">deduction_fees,
|
||||
</if>
|
||||
<if test="deductionFeesUnit != null">deduction_fees_unit,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
<if test="day != null">#{day},
|
||||
</if>
|
||||
<if test="deductionFees != null">#{deductionFees},
|
||||
</if>
|
||||
<if test="deductionFeesUnit != null">#{deductionFeesUnit},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketRefundRule" parameterType="ZdyTicketRefundRule">
|
||||
update zdy_ticket_refund_rule
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id =
|
||||
#{ticketId},
|
||||
</if>
|
||||
<if test="day != null">day =
|
||||
#{day},
|
||||
</if>
|
||||
<if test="deductionFees != null">deduction_fees =
|
||||
#{deductionFees},
|
||||
</if>
|
||||
<if test="deductionFeesUnit != null">deduction_fees_unit =
|
||||
#{deductionFeesUnit},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketRefundRuleById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_refund_rule
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketRefundRuleByIds" parameterType="String">
|
||||
delete from zdy_ticket_refund_rule where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteZdyTicketRefundRuleByTicketId" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_refund_rule
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,148 @@
|
||||
<?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.ticket.mapper.ZdyTicketSpecialAreaMapper">
|
||||
|
||||
<resultMap type="ZdyTicketSpecialArea" id="ZdyTicketSpecialAreaResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="provinceName" column="province_name"/>
|
||||
<result property="cityName" column="city_name"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="provinceCode" column="province_code"/>
|
||||
<result property="cityCode" column="city_code"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketSpecialAreaVo">
|
||||
select id,
|
||||
ticket_id,
|
||||
province_name,
|
||||
city_name,
|
||||
area_name,
|
||||
province_code,
|
||||
city_code,
|
||||
area_code
|
||||
from zdy_ticket_special_area
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketSpecialAreaList" parameterType="ZdyTicketSpecialArea"
|
||||
resultMap="ZdyTicketSpecialAreaResult">
|
||||
<include refid="selectZdyTicketSpecialAreaVo"/>
|
||||
<where>
|
||||
<if test="ticketId != null ">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test="provinceName != null and provinceName != ''">
|
||||
and province_name like concat('%', #{provinceName}, '%')
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">
|
||||
and city_name like concat('%', #{cityName}, '%')
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
and area_name like concat('%', #{areaName}, '%')
|
||||
</if>
|
||||
<if test="provinceCode != null ">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
<if test="cityCode != null ">
|
||||
and city_code = #{cityCode}
|
||||
</if>
|
||||
<if test="areaCode != null ">
|
||||
and area_code = #{areaCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketSpecialAreaById" parameterType="Long"
|
||||
resultMap="ZdyTicketSpecialAreaResult">
|
||||
<include refid="selectZdyTicketSpecialAreaVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketSpecialArea" parameterType="ZdyTicketSpecialArea" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_special_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
<if test="provinceName != null and provinceName != ''">province_name,
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">city_name,
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">area_name,
|
||||
</if>
|
||||
<if test="provinceCode != null">province_code,
|
||||
</if>
|
||||
<if test="cityCode != null">city_code,
|
||||
</if>
|
||||
<if test="areaCode != null">area_code,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
<if test="provinceName != null and provinceName != ''">#{provinceName},
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">#{cityName},
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">#{areaName},
|
||||
</if>
|
||||
<if test="provinceCode != null">#{provinceCode},
|
||||
</if>
|
||||
<if test="cityCode != null">#{cityCode},
|
||||
</if>
|
||||
<if test="areaCode != null">#{areaCode},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketSpecialArea" parameterType="ZdyTicketSpecialArea">
|
||||
update zdy_ticket_special_area
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id =
|
||||
#{ticketId},
|
||||
</if>
|
||||
<if test="provinceName != null and provinceName != ''">province_name =
|
||||
#{provinceName},
|
||||
</if>
|
||||
<if test="cityName != null and cityName != ''">city_name =
|
||||
#{cityName},
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">area_name =
|
||||
#{areaName},
|
||||
</if>
|
||||
<if test="provinceCode != null">province_code =
|
||||
#{provinceCode},
|
||||
</if>
|
||||
<if test="cityCode != null">city_code =
|
||||
#{cityCode},
|
||||
</if>
|
||||
<if test="areaCode != null">area_code =
|
||||
#{areaCode},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketSpecialAreaById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_special_area
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketSpecialAreaByIds" parameterType="String">
|
||||
delete from zdy_ticket_special_area where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteZdyTicketSpecialAreaByTicketId" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_special_area
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,128 @@
|
||||
<?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.ticket.mapper.ZdyTicketUnavailableHolidayMapper">
|
||||
|
||||
<resultMap type="ZdyTicketUnavailableHoliday" id="ZdyTicketUnavailableHolidayResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="holidayId" column="holiday_id"/>
|
||||
<result property="beginTime" column="begin_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="holidayDict" column="holiday_dict"/>
|
||||
<result property="holidayType" column="holiday_type"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketUnavailableHolidayVo">
|
||||
select id, ticket_id, holiday_id, begin_time, end_time,holiday_dict,holiday_type
|
||||
from zdy_ticket_unavailable_holiday
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketUnavailableHolidayList" parameterType="ZdyTicketUnavailableHoliday"
|
||||
resultMap="ZdyTicketUnavailableHolidayResult">
|
||||
<include refid="selectZdyTicketUnavailableHolidayVo"/>
|
||||
<where>
|
||||
<if test="ticketId != null ">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
<if test="holidayId != null ">
|
||||
and holiday_id = #{holidayId}
|
||||
</if>
|
||||
<if test="beginTime != null ">
|
||||
and begin_time = #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null ">
|
||||
and end_time = #{endTime}
|
||||
</if>
|
||||
<if test="holidayDict != null ">
|
||||
and holiday_dict = #{holidayDict}
|
||||
</if>
|
||||
<if test="holidayType != null ">
|
||||
and holiday_type = #{holidayType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyTicketUnavailableHolidayById" parameterType="Long"
|
||||
resultMap="ZdyTicketUnavailableHolidayResult">
|
||||
<include refid="selectZdyTicketUnavailableHolidayVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketUnavailableHoliday" parameterType="ZdyTicketUnavailableHoliday" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_unavailable_holiday
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
<if test="holidayId != null">holiday_id,
|
||||
</if>
|
||||
<if test="beginTime != null">begin_time,
|
||||
</if>
|
||||
<if test="endTime != null">end_time,
|
||||
</if>
|
||||
<if test="holidayDict != null">holiday_dict,
|
||||
</if>
|
||||
<if test="holidayType != null">holiday_type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
<if test="holidayId != null">#{holidayId},
|
||||
</if>
|
||||
<if test="beginTime != null">#{beginTime},
|
||||
</if>
|
||||
<if test="endTime != null">#{endTime},
|
||||
</if>
|
||||
<if test="holidayDict != null">#{holidayDict},
|
||||
</if>
|
||||
<if test="holidayType != null">#{holidayType},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyTicketUnavailableHoliday" parameterType="ZdyTicketUnavailableHoliday">
|
||||
update zdy_ticket_unavailable_holiday
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id =
|
||||
#{ticketId},
|
||||
</if>
|
||||
<if test="holidayId != null">holiday_id =
|
||||
#{holidayId},
|
||||
</if>
|
||||
<if test="beginTime != null">begin_time =
|
||||
#{beginTime},
|
||||
</if>
|
||||
<if test="endTime != null">end_time =
|
||||
#{endTime},
|
||||
</if>
|
||||
<if test="holidayDict != null">holiday_dict =
|
||||
#{holidayDict},
|
||||
</if>
|
||||
<if test="holidayType != null">holiday_type =
|
||||
#{holidayType},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyTicketUnavailableHolidayById" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_unavailable_holiday
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyTicketUnavailableHolidayByIds" parameterType="String">
|
||||
delete from zdy_ticket_unavailable_holiday where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteZdyTicketUnavailableHolidayByTicketId" parameterType="Long">
|
||||
delete
|
||||
from zdy_ticket_unavailable_holiday
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,47 @@
|
||||
<?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.ticket.mapper.ZdyTicketUnavailableTimeMapper">
|
||||
|
||||
<resultMap type="ZdyTicketUnavailableTime" id="ZdyTicketUnavailableTimeResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
<result property="beginTime" column="begin_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketUnavailableTimeVo">
|
||||
select id, ticket_id, begin_time, end_time
|
||||
from zdy_ticket_unavailable_time
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketUnavailableTimeList" parameterType="ZdyTicketUnavailableTime" resultMap="ZdyTicketUnavailableTimeResult">
|
||||
<include refid="selectZdyTicketUnavailableTimeVo"/>
|
||||
<where>
|
||||
<if test="ticketId != null "> and ticket_id = #{ticketId}</if>
|
||||
<if test="beginTime != null "> and begin_time = #{beginTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketUnavailableTime" parameterType="ZdyTicketUnavailableTime" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into zdy_ticket_unavailable_time
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">ticket_id,</if>
|
||||
<if test="beginTime != null">begin_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ticketId != null">#{ticketId},</if>
|
||||
<if test="beginTime != null">#{beginTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteZdyTicketUnavailableTimeByTicketId" parameterType="Long">
|
||||
delete from zdy_ticket_unavailable_time where ticket_id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,65 @@
|
||||
<?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.ticket.mapper.ZdyTicketUserMapper">
|
||||
|
||||
<resultMap type="ZdyTicketUser" id="ZdyTicketUserResult">
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="ticketId" column="ticket_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyTicketUserVo">
|
||||
select user_id, ticket_id
|
||||
from zdy_ticket_user
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyTicketUserList" parameterType="ZdyTicketUser" resultMap="ZdyTicketUserResult">
|
||||
<include refid="selectZdyTicketUserVo"/>
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId}
|
||||
</if>
|
||||
<if test="ticketId != null">
|
||||
and ticket_id = #{ticketId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getTicketIdsByUserId" parameterType="Long" resultType="java.lang.Long">
|
||||
select ticket_id
|
||||
from zdy_ticket_user
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyTicketUser" parameterType="ZdyTicketUser">
|
||||
insert into zdy_ticket_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,
|
||||
</if>
|
||||
<if test="ticketId != null">ticket_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},
|
||||
</if>
|
||||
<if test="ticketId != null">#{ticketId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByUserIdAndTicketIds">
|
||||
delete from zdy_ticket_user where
|
||||
user_id = #{userId}
|
||||
and ticket_id in
|
||||
<foreach item="ticketId" collection="ticketIds" open="(" separator="," close=")">
|
||||
#{ticketId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByTicketId">
|
||||
delete
|
||||
from zdy_ticket_user
|
||||
where ticket_id = #{ticketId}
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user