支付
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,135 @@
|
||||
<?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.travelagency.report.mapper.TravelAgencyReportMapper">
|
||||
|
||||
<resultMap type="com.zhwl.travelagency.report.vo.GuideSaleSummaryVO" id="GuideSaleSummaryVoResult">
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="guideName" column="guide_name"/>
|
||||
<result property="travelAgencyName" column="travel_agency_name"/>
|
||||
<result property="ticketName" column="ticket_name"/>
|
||||
<result property="leadingGroupTime" column="leading_group_time"/>
|
||||
<result property="leadingGroupPersons" column="leading_group_persons"/>
|
||||
<result property="customerSourceArea" column="customer_source_area"/>
|
||||
<result property="phone" column="phone"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryGuideSaleSummary" parameterType="com.zhwl.travelagency.report.dto.GuideSaleSummaryDTO"
|
||||
resultMap="GuideSaleSummaryVoResult">
|
||||
select
|
||||
a.id order_id,
|
||||
b.name guide_name,
|
||||
b.phone phone,
|
||||
c.name travel_agency_name,
|
||||
d.ticket_name ticket_name,
|
||||
a.create_time leading_group_time,
|
||||
a.tourist_source customer_source_area,
|
||||
a.tours_num leading_group_persons
|
||||
from zdy_ticket_order a
|
||||
left join zdy_travel_agency_guide b on b.id = a.tour_id
|
||||
left join zdy_travel_agency_info c on c.id = b.travel_agency_id
|
||||
left join zdy_ticket_order_item d on d.order_id = a.id
|
||||
<where>
|
||||
and a.travel_agency_id is not null
|
||||
<if test="travelAgencyId!=null">
|
||||
and c.id = #{travelAgencyId}
|
||||
</if>
|
||||
<if test="guideName !=null and guideName !='' ">
|
||||
and b.name like concat('%',#{guideName},'%')
|
||||
</if>
|
||||
<if test="travelAgencyName !=null and travelAgencyName !='' ">
|
||||
and c.name like concat('%',#{travelAgencyName},'%')
|
||||
</if>
|
||||
<if test="ticketName !=null and ticketName !='' ">
|
||||
and d.ticket_name like concat('%',#{ticketName},'%')
|
||||
</if>
|
||||
<if test="customerSourceArea !=null and customerSourceArea !='' ">
|
||||
and a.tourist_source = #{customerSourceArea}
|
||||
</if>
|
||||
<if test="params.startLeadingGroupTime != null and params.startLeadingGroupTime != ''"><!-- 带团开始时间检索 -->
|
||||
and date_format(a.create_time,'%y%m%d') >= date_format(#{params.startLeadingGroupTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endLeadingGroupTime != null and params.endLeadingGroupTime != ''"><!-- 带团结束时间检索 -->
|
||||
and date_format(a.create_time,'%y%m%d') <= date_format(#{params.endLeadingGroupTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="phone !=null and phone !='' ">
|
||||
and b.phone like concat('%',#{phone},'%')
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="countAccumulatedTeamLeadersNumber" parameterType="long" resultType="int">
|
||||
select ifnull(sum(ifnull(tours_num, 0)),0)
|
||||
from zdy_ticket_order
|
||||
where del_flag = '0'
|
||||
and payment_type = 200
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectOverViewToday" parameterType="long"
|
||||
resultType="com.zhwl.travelagency.report.vo.TravelAgencyDataStatisticsVo">
|
||||
select count(1) todayOrderNumber,
|
||||
ifnull(sum(ifnull(total_price, 0)), 0) todaySalesPrice,
|
||||
ifnull(sum(ifnull(tours_num, 0)), 0) todayTeamLeadersNumber
|
||||
from zdy_ticket_order
|
||||
WHERE del_flag = 0
|
||||
and DATE (create_time) = CURDATE()
|
||||
AND payment_type = 200
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
</select>
|
||||
|
||||
<select id="tourGuideAndGroupStatisticsLastWeek" resultType="com.github.duanyashu.chartscp.ChartscpResultMap">
|
||||
select b.name xcell, a.data data
|
||||
from (select tour_id,
|
||||
sum(ifnull(tours_num, 0)) data
|
||||
from zdy_ticket_order
|
||||
WHERE payment_type = 200
|
||||
AND del_flag = 0
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
and create_time >= CURDATE() - INTERVAL 7 DAY
|
||||
GROUP BY tour_id) a
|
||||
left join zdy_travel_agency_guide b
|
||||
on a.tour_id = b.id where b.del_flag = '0'
|
||||
</select>
|
||||
<select id="tourGuideAndGroupStatisticsLastMonth" resultType="com.github.duanyashu.chartscp.ChartscpResultMap">
|
||||
select b.name xcell, a.data data
|
||||
from (select tour_id,
|
||||
sum(ifnull(tours_num, 0)) data
|
||||
from zdy_ticket_order
|
||||
WHERE payment_type = 200
|
||||
AND del_flag = 0
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
and create_time >= CURDATE() - INTERVAL 30 DAY
|
||||
GROUP BY tour_id) a
|
||||
left join zdy_travel_agency_guide b
|
||||
on a.tour_id = b.id where b.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="orderStatistics" parameterType="long" resultType="com.zhwl.travelagency.report.vo.OrderStatisticsVO">
|
||||
select DATE_FORMAT(create_time, '%m-%d') statisticsDate, count(1) orderNumber, sum(ifnull(total_price, 0)) orderSalesPrice
|
||||
from zdy_ticket_order
|
||||
WHERE del_flag = 0
|
||||
and create_time >= CURDATE() - INTERVAL 7 DAY
|
||||
AND payment_type = 200
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
group by DATE_FORMAT(create_time, '%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="customerSourcesRank" parameterType="long"
|
||||
resultType="com.zhwl.travelagency.report.vo.CustomerSourcesVo">
|
||||
select b.name customerSourcesName, a.frequency
|
||||
from (select tourist_source, sum(ifnull(tours_num, 0)) frequency
|
||||
from zdy_ticket_order
|
||||
WHERE del_flag = 0
|
||||
AND payment_type = 200
|
||||
and travel_agency_id = #{travelAgencyId}
|
||||
group by tourist_source) a
|
||||
left join zdy_area b on a.tourist_source = b.area_code
|
||||
where a.tourist_source is not null
|
||||
order by frequency desc limit 5
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user