@ -142,7 +141,6 @@ public interface HighOrderMapperExt {
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName,"+
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName,"+
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType, "+
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType, "+
" a.goods_name goodsName, "+
" a.goods_name goodsName, "+
" b.id orderId, "+
" a.goods_type goodsTypeId,"+
" a.goods_type goodsTypeId,"+
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType,"+
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType,"+
" b.order_no orderNo,"+
" b.order_no orderNo,"+
@ -176,7 +174,7 @@ public interface HighOrderMapperExt {
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName,"+
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType,"+
" b.id orderId, "+
" a.goods_name goodsName, "+
" a.goods_type goodsTypeId,"+
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType,"+
" b.order_no orderNo,"+
" b.mem_name memName,"+
" b.mem_phone memPhone,"+
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, "+
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end payType,"+
" b.pay_serial_no paySerialNo,"+
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice,"+
" b.mem_discount_name memDiscountName,"+
" b.deduction_price deductionPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold,"+
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice,"+
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, "+
" b.order_status orderStatusId,"+
" b.create_time createTime,"+
" b.pay_time payTime,"+
" b.cancel_time cancelTime,"+
" b.refund_time refundTime,"+
" b.refund_content refundContent,"+
" b.refusal_refund_content refusalRefundContent"+
" FROM"+
" high_child_order a,"+
" high_order b"+
" WHERE"+
" a.order_id = b.id"+
" and a.goods_type = 3"+
" and a.giveaway_type = 0"+
" and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id "+
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName,"+
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName,"+
@ -658,7 +604,7 @@ public interface HighOrderMapperExt {
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
") as hh; ",
") as hh; ",
@ -1036,9 +982,9 @@ public interface HighOrderMapperExt {
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> ",
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> ",
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> ",
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> ",
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
") as hh; ",
") as hh; ",
@ -1061,7 +1007,7 @@ public interface HighOrderMapperExt {
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> ",
") as hh; ",
") as hh; ",
@ -1073,12 +1019,12 @@ public interface HighOrderMapperExt {
@Select(value={
@Select(value={
"<script>",
"<script>",
"select count(*) as value , "+
"select count(*) as value , "+
"case pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end name "+
"case pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' when 5 then '银联' end name "+
"from high_order ho join high_child_order hco on ho.id = hco.order_id ",
"from high_order ho join high_child_order hco on ho.id = hco.order_id ",
"where hco.goods_type = 3 and ho.order_status in (2, 3) ",
"where hco.goods_type = 3 and ho.order_status in (2, 3) ",
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </if> ",
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </if> ",
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.companyId != null'> AND hco.gas_org_id in (select id from bs_organization WHERE company_id = #{map.companyId} and `status` = 1) </if> "+
"<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> ",
"<if test='map.gasOilNo != null'> and hco.gas_oil_no = #{map.gasOilNo} </if> ",
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> ",
"<if test='map.gasOilType != null'> and hco.gas_oil_type = #{map.gasOilType} </if> ",
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> ",
"<if test='map.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> ",
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
"<if test='map.gasSalesmanId != null'> and hco.gas_salesman_id = #{map.gasSalesmanId} </if> ",
@ -1120,100 +1066,43 @@ public interface HighOrderMapperExt {
@Select({" select"+
@Select({" select"+
" case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price,"+
" case when SUM(gas_refuel_price) is null then 0 else SUM(gas_refuel_price) end price,"+
" count(1) count"+
" count(1) count"+
" from high_child_order a,high_order b "+
" from high_gas_order where store_id = #{storeId} and status in (${status}) "+
" where a.order_id = b.id and goods_type = 3 and goods_id = #{storeId} and b.order_status in (${status}) "+