视频监控
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

291 lines
16 KiB

<?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.cjy.ticketing.mapper.TicketingTicketCheckFlowMapper">
<resultMap type="TicketingTicketCheckFlow" id="TicketingTicketCheckFlowResult">
<result property="id" column="id" />
<result property="ticketCheckDate" column="ticket_check_date" />
<result property="resourceId" column="resource_id" />
<result property="attractionsId" column="attractions_id" />
<result property="siteId" column="site_id" />
<result property="equipmentId" column="equipment_id" />
<result property="productId" column="product_id" />
<result property="inAndOutDirection" column="in_and_out_direction" />
<result property="ticketCheckTotal" column="ticket_check_total" />
<result property="firstDayToursNumber" column="first_day_tours_number" />
<result property="twoDayToursNumber" column="two_day_tours_number" />
<result property="threeDayTourQuantity" column="three_day_tour_quantity" />
<result property="multiDayToursNumber" column="multi_day_tours_number" />
<result property="financialYear" column="financial_year" />
<result property="dataSources" column="data_sources" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="organCode" column="organ_code" />
</resultMap>
<sql id="selectTicketingTicketCheckFlowVo">
select id, ticket_check_date, resource_id, attractions_id, site_id, equipment_id, product_id, in_and_out_direction, ticket_check_total, first_day_tours_number, two_day_tours_number, three_day_tour_quantity, multi_day_tours_number, financial_year, data_sources, del_flag, create_by, create_time, update_by, update_time, organ_code from ticketing_ticket_check_flow
</sql>
<select id="selectTicketingTicketCheckFlowList" parameterType="TicketingTicketCheckFlow" resultMap="TicketingTicketCheckFlowResult">
SELECT
tc.id,
tc.ticket_check_date,
tc.resource_id,
t.resource_name AS resourceName,
tc.attractions_id,
a.attractions_name AS attractionsName,
tc.site_id,
s.site_name AS siteName,
tc.equipment_id,
e.equipment_name AS equipmentName,
tc.product_id,
p.product_name AS productName,
tc.in_and_out_direction,
tc.ticket_check_total,
tc.first_day_tours_number,
tc.two_day_tours_number,
tc.three_day_tour_quantity,
tc.multi_day_tours_number,
tc.financial_year,
tc.data_sources,
tc.del_flag,
tc.create_by,
tc.create_time,
tc.update_by,
tc.update_time,
tc.organ_code
FROM
ticketing_ticket_check_flow tc
LEFT JOIN b_tour_info t ON tc.resource_id = t.id
LEFT JOIN ticketing_attractions a ON tc.attractions_id = a.id
LEFT JOIN ticketing_site s ON tc.site_id = s.id
LEFT JOIN ticketing_product p ON tc.product_id = p.id
LEFT JOIN ticketing_equipment e ON tc.equipment_id = e.id
<where>
<if test="productName != null and productName!='' "> and p.product_name = #{productName}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and tc.ticket_check_date between #{startDate} and #{endDate}</if>
<if test="resourceId != null "> and tc.resource_id = #{resourceId}</if>
<if test="attractionsId != null "> and tc.attractions_id = #{attractionsId}</if>
<if test="siteId != null "> and tc.site_id = #{siteId}</if>
<if test="equipmentId != null "> and tc.equipment_id = #{equipmentId}</if>
<if test="productId != null "> and tc.product_id = #{productId}</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''"> and tc.in_and_out_direction = #{inAndOutDirection}</if>
<if test="ticketCheckTotal != null "> and tc.ticket_check_total = #{ticketCheckTotal}</if>
<if test="firstDayToursNumber != null "> and tc.first_day_tours_number = #{firstDayToursNumber}</if>
<if test="twoDayToursNumber != null "> and tc.two_day_tours_number = #{twoDayToursNumber}</if>
<if test="threeDayTourQuantity != null "> and tc.three_day_tour_quantity = #{threeDayTourQuantity}</if>
<if test="multiDayToursNumber != null "> and tc.multi_day_tours_number = #{multiDayToursNumber}</if>
<if test="financialYear != null and financialYear != ''"> and tc.financial_year = #{financialYear}</if>
<if test="dataSources != null and dataSources != ''"> and tc.data_sources = #{dataSources}</if>
<if test="organCode != null "> and tc.organ_code = #{organCode}</if>
and tc.del_flag!=2
</where>
order by tc.create_time desc
</select>
<select id="checkFlowReport" resultType="com.cjy.ticketing.vo.TicketCheckFlowVO">
SELECT
tc.ticket_check_date AS ticketCheckDate,
tc.resource_id AS resourceId,
t.resource_name AS resourceName,
tc.attractions_id AS attractionsId,
a.attractions_name AS attractionsName,
tc.site_id AS siteId ,
s.site_name AS siteName,
tc.equipment_id AS equipmentId,
e.equipment_name AS equipmentName,
tc.in_and_out_direction AS inAndOutDirection,
tc.ticket_check_total AS ticketCheckTotal
FROM
ticketing_ticket_check_flow tc
LEFT JOIN b_tour_info t ON tc.resource_id = t.id
LEFT JOIN ticketing_attractions a ON tc.attractions_id = a.id
LEFT JOIN ticketing_site s ON tc.site_id = s.id
LEFT JOIN ticketing_equipment e ON tc.equipment_id = e.id
<where>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and tc.ticket_check_date between #{startDate} and #{endDate}</if>
<if test="resourceId != null "> and tc.resource_id = #{resourceId}</if>
<if test="attractionsId != null "> and tc.attractions_id = #{attractionsId}</if>
<if test="siteId != null "> and tc.site_id = #{siteId}</if>
<if test="equipmentId != null "> and tc.equipment_id = #{equipmentId}</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''"> and tc.in_and_out_direction = #{inAndOutDirection}</if>
<if test="ticketCheckTotal != null "> and tc.ticket_check_total = #{ticketCheckTotal}</if>
<if test="organCode != null "> and tc.organ_code = #{organCode}</if>
and tc.del_flag!=2
</where>
order by tc.create_time desc
</select>
<select id="checkSummaryReport" resultType="com.cjy.ticketing.vo.TicketCheckFlowVO">
SELECT
DATE_FORMAT(tc.ticket_check_date,'%Y-%m-%d') as ticketCheckDate,
tc.resource_id AS resourceId,
t.resource_name AS resourceName,
tc.attractions_id AS attractionsId,
a.attractions_name AS attractionsName,
tc.site_id AS siteId ,
s.site_name AS siteName,
tc.equipment_id AS equipmentId,
e.equipment_name AS equipmentName,
tc.in_and_out_direction AS inAndOutDirection,
sum(tc.ticket_check_total) AS ticketCheckTotal
FROM
ticketing_ticket_check_flow tc
LEFT JOIN b_tour_info t ON tc.resource_id = t.id
LEFT JOIN ticketing_attractions a ON tc.attractions_id = a.id
LEFT JOIN ticketing_site s ON tc.site_id = s.id
LEFT JOIN ticketing_equipment e ON tc.equipment_id = e.id
<where>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and DATE_FORMAT( tc.ticket_check_date, '%Y-%m-%d' ) between #{startDate} and #{endDate}</if>
<if test="resourceId != null "> and tc.resource_id = #{resourceId}</if>
<if test="attractionsId != null "> and tc.attractions_id = #{attractionsId}</if>
<if test="siteId != null "> and tc.site_id = #{siteId}</if>
<if test="equipmentId != null "> and tc.equipment_id = #{equipmentId}</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''"> and tc.in_and_out_direction = #{inAndOutDirection}</if>
<if test="ticketCheckTotal != null "> and tc.ticket_check_total = #{ticketCheckTotal}</if>
<if test="organCode != null "> and tc.organ_code = #{organCode}</if>
and tc.del_flag!=2
</where>
GROUP BY
tc.ticket_check_date,
tc.resource_id,
tc.attractions_id,
tc.site_id,
tc.product_id,
tc.equipment_id,
tc.in_and_out_direction
</select>
<select id="selectTicketingTicketCheckFlowById" parameterType="Long" resultMap="TicketingTicketCheckFlowResult">
SELECT
tc.id,
tc.ticket_check_date,
tc.resource_id,
t.resource_name AS resourceName,
tc.attractions_id,
a.attractions_name AS attractionsName,
tc.site_id,
s.site_name AS siteName,
tc.equipment_id,
e.equipment_name AS equipmentName,
tc.product_id,
p.product_name AS productName,
tc.in_and_out_direction,
tc.ticket_check_total,
tc.first_day_tours_number,
tc.two_day_tours_number,
tc.three_day_tour_quantity,
tc.multi_day_tours_number,
tc.financial_year,
tc.data_sources,
tc.del_flag,
tc.create_by,
tc.create_time,
tc.update_by,
tc.update_time,
tc.organ_code
FROM
ticketing_ticket_check_flow tc
LEFT JOIN b_tour_info t ON tc.resource_id = t.id
LEFT JOIN ticketing_attractions a ON tc.attractions_id = a.id
LEFT JOIN ticketing_site s ON tc.site_id = s.id
LEFT JOIN ticketing_product p ON tc.product_id = p.id
LEFT JOIN ticketing_equipment e ON tc.equipment_id = e.id
where tc.id = #{id}
</select>
<insert id="insertTicketingTicketCheckFlow" parameterType="TicketingTicketCheckFlow">
insert into ticketing_ticket_check_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ticketCheckDate != null">ticket_check_date,</if>
<if test="resourceId != null">resource_id,</if>
<if test="attractionsId != null">attractions_id,</if>
<if test="siteId != null">site_id,</if>
<if test="equipmentId != null">equipment_id,</if>
<if test="productId != null">product_id,</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''">in_and_out_direction,</if>
<if test="ticketCheckTotal != null">ticket_check_total,</if>
<if test="firstDayToursNumber != null">first_day_tours_number,</if>
<if test="twoDayToursNumber != null">two_day_tours_number,</if>
<if test="threeDayTourQuantity != null">three_day_tour_quantity,</if>
<if test="multiDayToursNumber != null">multi_day_tours_number,</if>
<if test="financialYear != null">financial_year,</if>
<if test="dataSources != null and dataSources != ''">data_sources,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="organCode != null">organ_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ticketCheckDate != null">#{ticketCheckDate},</if>
<if test="resourceId != null">#{resourceId},</if>
<if test="attractionsId != null">#{attractionsId},</if>
<if test="siteId != null">#{siteId},</if>
<if test="equipmentId != null">#{equipmentId},</if>
<if test="productId != null">#{productId},</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''">#{inAndOutDirection},</if>
<if test="ticketCheckTotal != null">#{ticketCheckTotal},</if>
<if test="firstDayToursNumber != null">#{firstDayToursNumber},</if>
<if test="twoDayToursNumber != null">#{twoDayToursNumber},</if>
<if test="threeDayTourQuantity != null">#{threeDayTourQuantity},</if>
<if test="multiDayToursNumber != null">#{multiDayToursNumber},</if>
<if test="financialYear != null">#{financialYear},</if>
<if test="dataSources != null and dataSources != ''">#{dataSources},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="organCode != null">#{organCode},</if>
</trim>
</insert>
<update id="updateTicketingTicketCheckFlow" parameterType="TicketingTicketCheckFlow">
update ticketing_ticket_check_flow
<trim prefix="SET" suffixOverrides=",">
<if test="ticketCheckDate != null">ticket_check_date = #{ticketCheckDate},</if>
<if test="resourceId != null">resource_id = #{resourceId},</if>
<if test="attractionsId != null">attractions_id = #{attractionsId},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="equipmentId != null">equipment_id = #{equipmentId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="inAndOutDirection != null and inAndOutDirection != ''">in_and_out_direction = #{inAndOutDirection},</if>
<if test="ticketCheckTotal != null">ticket_check_total = #{ticketCheckTotal},</if>
<if test="firstDayToursNumber != null">first_day_tours_number = #{firstDayToursNumber},</if>
<if test="twoDayToursNumber != null">two_day_tours_number = #{twoDayToursNumber},</if>
<if test="threeDayTourQuantity != null">three_day_tour_quantity = #{threeDayTourQuantity},</if>
<if test="multiDayToursNumber != null">multi_day_tours_number = #{multiDayToursNumber},</if>
<if test="financialYear != null">financial_year = #{financialYear},</if>
<if test="dataSources != null and dataSources != ''">data_sources = #{dataSources},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTicketingTicketCheckFlowById" parameterType="Long">
update ticketing_ticket_check_flow set del_flag='2' where id = #{id}
</delete>
<delete id="deleteTicketingTicketCheckFlowByIds" parameterType="String">
update ticketing_ticket_check_flow set del_flag='2' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>