|
|
@ -1317,6 +1317,295 @@ |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryOrderInfoTotalAmount" |
|
|
|
|
|
|
|
resultType="com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select |
|
|
|
|
|
|
|
sum(ifnull(cast(op.kphjje as decimal(18,6)),0)) as kphjje, |
|
|
|
|
|
|
|
sum(ifnull(cast(op.hjbhsje as decimal(18,6)),0)) as hjbhsje, |
|
|
|
|
|
|
|
sum(ifnull(cast(op.kpse as decimal(18,6)),0)) as kpse |
|
|
|
|
|
|
|
from order_process_info op |
|
|
|
|
|
|
|
left join order_invoice_info oii on op.id = oii.order_process_info_id |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<where> |
|
|
|
|
|
|
|
<!-- mysql数据库 --> |
|
|
|
|
|
|
|
<if test="dataType == 0"> |
|
|
|
|
|
|
|
<choose> |
|
|
|
|
|
|
|
<when |
|
|
|
|
|
|
|
test="map.minhjje !=null and map.minhjje != '' and map.maxhjje !=null and map.maxhjje != ''"> |
|
|
|
|
|
|
|
and cast(op.kphjje as DECIMAL) BETWEEN |
|
|
|
|
|
|
|
#{map.minhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
and |
|
|
|
|
|
|
|
#{map.maxhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<otherwise> |
|
|
|
|
|
|
|
<if test="map.minhjje !=null and map.minhjje != ''"> |
|
|
|
|
|
|
|
and cast(op.kphjje as DECIMAL) >= |
|
|
|
|
|
|
|
#{map.minhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.maxhjje !=null and map.maxhjje != ''"> |
|
|
|
|
|
|
|
and #{map.maxhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
>= cast(op.kphjje as DECIMAL) |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
</otherwise> |
|
|
|
|
|
|
|
</choose> |
|
|
|
|
|
|
|
<if test="map.startTime !=null and map.startTime != ''"> |
|
|
|
|
|
|
|
and op.ddcjsj >= #{map.startTime} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.endTime !=null and map.endTime != ''"> |
|
|
|
|
|
|
|
and #{map.endTime} >= op.ddcjsj |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.ddh != null and map.ddh != ''"> |
|
|
|
|
|
|
|
and op.ddh like "%"#{map.ddh,jdbcType=VARCHAR}"%" |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.gmfmc != null and map.gmfmc != ''"> |
|
|
|
|
|
|
|
and op.ghf_mc like |
|
|
|
|
|
|
|
concat('%',#{map.gmfmc,jdbcType=VARCHAR},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.xhfmc != null and map.xhfmc != ''"> |
|
|
|
|
|
|
|
and op.xhf_mc like |
|
|
|
|
|
|
|
concat('%',#{map.xhfmc,jdbcType=VARCHAR},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.sbyy != null and map.sbyy != ''"> |
|
|
|
|
|
|
|
and op.sbyy like |
|
|
|
|
|
|
|
concat('%',#{map.sbyy,jdbcType=VARCHAR},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<!-- oracle数据库 --> |
|
|
|
|
|
|
|
<if test="dataType == 1"> |
|
|
|
|
|
|
|
<choose> |
|
|
|
|
|
|
|
<when |
|
|
|
|
|
|
|
test="map.minhjje !=null and map.minhjje != '' and map.maxhjje !=null and map.maxhjje != ''"> |
|
|
|
|
|
|
|
and to_number(op.kphjje) BETWEEN |
|
|
|
|
|
|
|
#{map.minhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
and |
|
|
|
|
|
|
|
#{map.maxhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<otherwise> |
|
|
|
|
|
|
|
<if test="map.minhjje !=null and map.minhjje != ''"> |
|
|
|
|
|
|
|
and to_number(op.kphjje) >= |
|
|
|
|
|
|
|
#{map.minhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.maxhjje !=null and map.maxhjje != ''"> |
|
|
|
|
|
|
|
and #{map.maxhjje,jdbcType=DOUBLE} |
|
|
|
|
|
|
|
>= to_number(op.kphjje) |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
</otherwise> |
|
|
|
|
|
|
|
</choose> |
|
|
|
|
|
|
|
<if test="map.startTime !=null and map.startTime != ''"> |
|
|
|
|
|
|
|
and trunc(op.ddcjsj) |
|
|
|
|
|
|
|
>=to_date(#{map.startTime,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.endTime !=null and map.endTime != ''"> |
|
|
|
|
|
|
|
and to_date(#{map.endTime,jdbcType=VARCHAR},'yyyy-mm-dd |
|
|
|
|
|
|
|
hh24:mi:ss')>=trunc(op.ddcjsj) |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.ddh != null and map.ddh != ''"> |
|
|
|
|
|
|
|
and op.ddh like '%' || #{map.ddh,jdbcType=VARCHAR} || '%' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.gmfmc != null and map.gmfmc != ''"> |
|
|
|
|
|
|
|
and op.ghf_mc like '%' || #{map.gmfmc,jdbcType=VARCHAR} || |
|
|
|
|
|
|
|
'%' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.xhfmc != null and map.xhfmc != ''"> |
|
|
|
|
|
|
|
and op.xhf_mc like % || #{map.xhfmc,jdbcType=VARCHAR} || |
|
|
|
|
|
|
|
'%' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.sbyy != null and map.sbyy != ''"> |
|
|
|
|
|
|
|
and op.sbyy like % || #{map.sbyy,jdbcType=VARCHAR} || |
|
|
|
|
|
|
|
'%' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.ddzt != null and map.ddzt.size != 0"> |
|
|
|
|
|
|
|
and op.ddzt in |
|
|
|
|
|
|
|
<foreach collection="map.ddzt" index="index" item="ddzti" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{ddzti,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.ddly != null and map.ddly.size() != 0"> |
|
|
|
|
|
|
|
and op.ddly in |
|
|
|
|
|
|
|
<foreach collection="map.ddly" index="index" item="ddlyit" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{ddlyit,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.fpzldm != null and map.fpzldm.size() != 0"> |
|
|
|
|
|
|
|
and op.fpzl_dm in |
|
|
|
|
|
|
|
<foreach collection="map.fpzldm" index="index" item="fpzldmit" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{fpzldmit,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.fpqqlshList != null and map.fpqqlshList.size() == 1"> |
|
|
|
|
|
|
|
and op.fpqqlsh = |
|
|
|
|
|
|
|
<foreach collection="map.fpqqlshList" index="index" item="item"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.fpqqlshList != null and map.fpqqlshList.size() > 1"> |
|
|
|
|
|
|
|
and op.fpqqlsh in |
|
|
|
|
|
|
|
<foreach collection="map.fpqqlshList" index="index" item="item" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.kplshList != null and map.kplshList.size() == 1"> |
|
|
|
|
|
|
|
and oii.kplsh = |
|
|
|
|
|
|
|
<foreach collection="map.kplshList" index="index" item="item"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.kplshList != null and map.kplshList.size() > 1"> |
|
|
|
|
|
|
|
and oii.kplsh in |
|
|
|
|
|
|
|
<foreach collection="map.kplshList" index="index" item="item" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.sksbCode != null and map.sksbCode != ''"> |
|
|
|
|
|
|
|
and oii.sksbdm = #{map.sksbCode,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.tsJosList != null and map.tsJosList.size == 1"> |
|
|
|
|
|
|
|
and oii.push_jos_status = |
|
|
|
|
|
|
|
<foreach collection="map.tsJosList" index="index" item="item"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.tsJosList != null and map.tsJosList.size > 1"> |
|
|
|
|
|
|
|
and oii.push_jos_status in |
|
|
|
|
|
|
|
<foreach collection="map.tsJosList" index="index" item="tsJosListi" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{tsJosListi,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="map.ywlx != null and map.ywlx != ''"> |
|
|
|
|
|
|
|
and op.ywlx = #{map.ywlx,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.fplx != null and map.fplx != '' "> |
|
|
|
|
|
|
|
and op.fpzl_dm = #{map.fplx,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.ghfNsrsbh != null and map.ghfNsrsbh != ''"> |
|
|
|
|
|
|
|
and op.ghf_nsrsbh = #{map.ghfNsrsbh,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.orderStatus !=null and map.orderStatus !='' "> |
|
|
|
|
|
|
|
and op.order_status = #{map.orderStatus,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.checkStatus !=null and map.checkStatus !='' "> |
|
|
|
|
|
|
|
and op.check_status = #{map.checkStatus,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="shList != null and shList.size() == 0"> |
|
|
|
|
|
|
|
and op.xhf_nsrsbh = '' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="shList != null and shList.size() == 1"> |
|
|
|
|
|
|
|
and op.xhf_nsrsbh = |
|
|
|
|
|
|
|
<foreach collection="shList" index="index" item="item"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="shList != null and shList.size() > 1"> |
|
|
|
|
|
|
|
and op.xhf_nsrsbh in |
|
|
|
|
|
|
|
<foreach collection="shList" index="index" item="item" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="entList != null and entList.size() == 0"> |
|
|
|
|
|
|
|
and op.ent_id = '' |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="entList != null and entList.size() == 1"> |
|
|
|
|
|
|
|
and op.ent_id = |
|
|
|
|
|
|
|
<foreach collection="entList" index="index" item="item"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="entList != null and entList.size() > 1"> |
|
|
|
|
|
|
|
and op.ent_id in |
|
|
|
|
|
|
|
<foreach collection="entList" index="index" item="item" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{item} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.bzdh != null and map.bzdh != ''"> |
|
|
|
|
|
|
|
and op.bzdh = #{map.bzdh,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.xtly != null and map.xtly != ''"> |
|
|
|
|
|
|
|
and op.xtly = #{map.xtly,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.gsdm != null and map.gsdm != ''"> |
|
|
|
|
|
|
|
and op.gsdm = #{map.gsdm,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.bhzt != null and map.bhzt != ''"> |
|
|
|
|
|
|
|
and op.bhzt = #{map.bhzt,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.ygxm != null and map.ygxm != ''"> |
|
|
|
|
|
|
|
and op.ygxm = #{map.ygxm,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.kppzh != null and map.kppzh != ''"> |
|
|
|
|
|
|
|
and op.kppzh = #{map.kppzh,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.pzgzrq != null"> |
|
|
|
|
|
|
|
and op.pzgzrq = #{map.pzgzrq,jdbcType=TIMESTAMP} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.yzfp != null and map.yzfp != ''"> |
|
|
|
|
|
|
|
and op.yzfp = #{map.yzfp,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.originDdh != null and map.originDdh != ''"> |
|
|
|
|
|
|
|
and op.origin_ddh = #{map.originDdh,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.originOrderId != null and map.originOrderId != ''"> |
|
|
|
|
|
|
|
and op.origin_order_id = #{map.originOrderId,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.kb != null and map.kb != ''"> |
|
|
|
|
|
|
|
and op.kb = #{map.kb,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.pzgzrqBegin !=null and map.pzgzrqBegin != ''"> |
|
|
|
|
|
|
|
and op.pzgzrq >= #{map.pzgzrqBegin} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.pzgzrqEnd !=null and map.pzgzrqEnd != ''"> |
|
|
|
|
|
|
|
and #{map.pzgzrqEnd} >= op.pzgzrq |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.dyzt != null and map.dyzt != ''"> |
|
|
|
|
|
|
|
and oii.dyzt = #{map.dyzt,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.qdbz != null "> |
|
|
|
|
|
|
|
and oii.qd_bz in |
|
|
|
|
|
|
|
<foreach collection="map.qdbz" index="index" item="item" |
|
|
|
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
|
|
|
#{item,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="map.kplx != null and map.kplx != ''"> |
|
|
|
|
|
|
|
and oii.kplx = #{map.kplx,jdbcType=VARCHAR} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 异常订单列表根据订单更新时间排序 --> |
|
|
|
|
|
|
|
<choose> |
|
|
|
|
|
|
|
<when test="map.orderBy !=null and map.orderBy == 'updateTime' "> |
|
|
|
|
|
|
|
order by op.update_time desc |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<when test="map.orderBy !=null and map.orderBy == 'createTimeAsc' "> |
|
|
|
|
|
|
|
order by op.ddcjsj asc |
|
|
|
|
|
|
|
</when> |
|
|
|
|
|
|
|
<otherwise> |
|
|
|
|
|
|
|
order by op.ddcjsj desc,op.num desc,op.create_time desc,op.id desc |
|
|
|
|
|
|
|
</otherwise> |
|
|
|
|
|
|
|
</choose> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</where> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
</mapper> |
|
|
|