|
@@ -10,17 +10,19 @@
|
|
|
-->
|
|
-->
|
|
|
<select id="querySendList" resultType="com.yc.ship.module.trade.controller.admin.smsSendconfig.vo.SmsSendconfigQueryRespVO">
|
|
<select id="querySendList" resultType="com.yc.ship.module.trade.controller.admin.smsSendconfig.vo.SmsSendconfigQueryRespVO">
|
|
|
select * from (
|
|
select * from (
|
|
|
- select t1.*,t2.product_id,t3.product_name,tt2.short_name,t4.order_no,t3.use_date,count(1)
|
|
|
|
|
- num,t4.source_name,t5.contact_name,t5.mobile,t6.`name` as routeName,t7.api_template_id,t7.params templateParams,t8.api_key,t8.api_secret,t8.api_url,t8.signature,t8.code channelCode from
|
|
|
|
|
|
|
+ select t1.*,t4.group_no groupNo,t66.name voyageName,t77.name shipName,t67.name routeName ,t2.product_id,t3.product_name,tt2.short_name,t4.order_no,t3.use_date,count(1)
|
|
|
|
|
+ num,t4.source_name,t5.contact_name,t5.mobile,t7.api_template_id,t7.params templateParams,t8.api_key,t8.api_secret,t8.api_url,t8.signature,t8.code channelCode from
|
|
|
system_sms_sendconfig t1
|
|
system_sms_sendconfig t1
|
|
|
inner join system_sms_product t2 on t1.id = t2.sms_template_id
|
|
inner join system_sms_product t2 on t1.id = t2.sms_template_id
|
|
|
inner join trade_detail t3 on t2.product_id = t3.product_id
|
|
inner join trade_detail t3 on t2.product_id = t3.product_id
|
|
|
inner join product_spu tt2 on t3.product_id = tt2.id
|
|
inner join product_spu tt2 on t3.product_id = tt2.id
|
|
|
inner join trade_order t4 on t3.order_id = t4.id
|
|
inner join trade_order t4 on t3.order_id = t4.id
|
|
|
inner join trade_order_user t5 on t4.id=t5.order_id
|
|
inner join trade_order_user t5 on t4.id=t5.order_id
|
|
|
- left join product_route_plan t6 on t4.route_plan_id = t6.id
|
|
|
|
|
- inner join sanxia_system.system_sms_template t7 on t1.sms_template_id=t7.id
|
|
|
|
|
- inner join sanxia_system.system_sms_channel t8 on t8.id = t7.channel_id
|
|
|
|
|
|
|
+ inner join product_voyage t66 on t66.id = t4.voyage_id
|
|
|
|
|
+ inner join resource_route t67 on t66.route_id = t67.id
|
|
|
|
|
+ inner join resource_ship t77 on t77.id = t4.ship_id
|
|
|
|
|
+ inner join system_sms_template t7 on t1.sms_template_id=t7.id
|
|
|
|
|
+ inner join system_sms_channel t8 on t8.id = t7.channel_id
|
|
|
where t3.use_date <![CDATA[ >= ]]> DATE_SUB(CURDATE(), INTERVAL 0 DAY) and t3.use_date <![CDATA[ <=]]>
|
|
where t3.use_date <![CDATA[ >= ]]> DATE_SUB(CURDATE(), INTERVAL 0 DAY) and t3.use_date <![CDATA[ <=]]>
|
|
|
DATE_SUB(CURDATE(), INTERVAL -1 DAY)
|
|
DATE_SUB(CURDATE(), INTERVAL -1 DAY)
|
|
|
and t3.voucher_status in (1,2)
|
|
and t3.voucher_status in (1,2)
|
|
@@ -35,52 +37,20 @@
|
|
|
AND t1.send_type = 2
|
|
AND t1.send_type = 2
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY t1.id,t4.id
|
|
GROUP BY t1.id,t4.id
|
|
|
- UNION ALL
|
|
|
|
|
- select t1.*,t2.product_id,t3.product_name,tt2.short_name,t4.order_no,t3.use_date,count
|
|
|
|
|
- (1) num,t4.source_name,t5.contact_name,t5.mobile,t6.`name` as routeName,t7.api_template_id,t7.params templateParams,t8.api_key,t8.api_secret,t8.api_url,t8.signature,t8.code channelCode
|
|
|
|
|
- from system_sms_sendconfig t1
|
|
|
|
|
- inner join system_sms_product t2 on t1.id = t2.sms_template_id
|
|
|
|
|
- inner join trade_order t4 on t2.product_id = t4.route_plan_id
|
|
|
|
|
- inner join trade_detail t3 on t3.order_id = t4.id
|
|
|
|
|
- inner join product_spu tt2 on t3.product_id = tt2.id
|
|
|
|
|
- inner join trade_order_user t5 on t4.id=t5.order_id
|
|
|
|
|
- left join product_route_plan t6 on t4.route_plan_id = t6.id
|
|
|
|
|
- inner join sanxia_system.system_sms_template t7 on t1.sms_template_id=t7.id
|
|
|
|
|
- inner join sanxia_system.system_sms_channel t8 on t8.id = t7.channel_id
|
|
|
|
|
- where t3.use_date <![CDATA[ >= ]]> DATE_SUB(CURDATE(), INTERVAL 0 DAY) and t3.use_date <![CDATA[ <= ]]> DATE_SUB(CURDATE(), INTERVAL -1 DAY)
|
|
|
|
|
- and t3.voucher_status in (1,2)
|
|
|
|
|
- and t1.deleted = 0
|
|
|
|
|
- and t2.deleted = 0
|
|
|
|
|
- and t7.deleted = 0
|
|
|
|
|
- and t1.is_use = 1
|
|
|
|
|
- <if test="id != null">
|
|
|
|
|
- AND t1.id = #{id}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="type != null and type == 0">
|
|
|
|
|
- AND t1.send_type = 2
|
|
|
|
|
- </if>
|
|
|
|
|
- GROUP BY t1.id,t4.id
|
|
|
|
|
) m where not EXISTS (
|
|
) m where not EXISTS (
|
|
|
select p1.order_no from system_sms_send_log p1 where status = 1 and m.order_no=p1.order_no and p1.sms_config_id = m.id
|
|
select p1.order_no from system_sms_send_log p1 where status = 1 and m.order_no=p1.order_no and p1.sms_config_id = m.id
|
|
|
)
|
|
)
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="querySendLogList" resultType="com.yc.ship.module.trade.controller.admin.smsSendconfig.vo.SmsSendconfigQueryRespVO">
|
|
<select id="querySendLogList" resultType="com.yc.ship.module.trade.controller.admin.smsSendconfig.vo.SmsSendconfigQueryRespVO">
|
|
|
- select t1.*,t3.product_id,t3.product_name,tt2.short_name,t3.use_date,count(1)
|
|
|
|
|
- num,t2.source_name,t5.contact_name,t6.`name` as routeName from
|
|
|
|
|
|
|
+ select t1.*,t2.source_name,t5.contact_name from
|
|
|
system_sms_send_log t1
|
|
system_sms_send_log t1
|
|
|
inner join trade_order t2 on t1.order_no = t2.order_no
|
|
inner join trade_order t2 on t1.order_no = t2.order_no
|
|
|
- inner join trade_detail t3 on t2.id = t3.order_id
|
|
|
|
|
- inner join product_spu tt2 on t3.product_id = tt2.id
|
|
|
|
|
inner join trade_order_user t5 on t2.id=t5.order_id
|
|
inner join trade_order_user t5 on t2.id=t5.order_id
|
|
|
- left join product_route_plan t6 on t2.route_plan_id = t6.id
|
|
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="param.smsConfigId != null">
|
|
<if test="param.smsConfigId != null">
|
|
|
AND t1.sms_config_id = #{param.smsConfigId}
|
|
AND t1.sms_config_id = #{param.smsConfigId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="param.travelDate != null and param.travelDate!=''">
|
|
|
|
|
- AND t3.use_date = #{param.travelDate}
|
|
|
|
|
- </if>
|
|
|
|
|
<if test="param.contact != null and param.contact!=''">
|
|
<if test="param.contact != null and param.contact!=''">
|
|
|
AND (t5.contact_name = #{param.contact} or t1.mobile = #{param.contact})
|
|
AND (t5.contact_name = #{param.contact} or t1.mobile = #{param.contact})
|
|
|
</if>
|
|
</if>
|