@ -1,5 +1,4 @@
package com.hai.dao ;
package com.hai.dao ;
import com.hai.entity.HighOrder ;
import com.hai.entity.HighOrder ;
import com.hai.model.* ;
import com.hai.model.* ;
import org.apache.ibatis.annotations.Param ;
import org.apache.ibatis.annotations.Param ;
@ -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," +
@ -191,58 +189,6 @@ public interface HighOrderMapperExt {
"</script>" } )
"</script>" } )
List < HighOrderModel > selectGoodsOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
List < HighOrderModel > selectGoodsOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { "<script>" +
" SELECT" +
" (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 " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +
" <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>" ,
" <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>" ,
" <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>" ,
" <if test='map.payType != null'> and b.pay_type = #{map.payType} </if>" ,
" <if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>" ,
" <if test='map.createTimeS != null'> <![CDATA[ and b.create_time >= #{map.createTimeS} ]]> </if>" ,
" <if test='map.createTimeE != null'> <![CDATA[ and b.create_time <= #{map.createTimeE} ]]> </if>" ,
" <if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>" ,
" <if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>" ,
" GROUP BY a.id ORDER BY b.create_time desc" +
"</script>" } )
List < HighOrderModel > selectGasOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { "<script>" +
@Select ( { "<script>" +
" SELECT" +
" SELECT" +
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName," +
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName," +
@ -1120,96 +1066,39 @@ public interface HighOrderMapperExt {
@Select ( { " select" +
@Select ( { " select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.tota l_price) end price," +
" case when SUM(gas_refuel_price) is null then 0 else SUM(gas_refue l_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}) " +
" and to_days(pay_time) = to_days(now())" } )
" and to_days(pay_time) = to_days(now())" } )
Map < String , Object > selectGasTheDayOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
Map < String , Object > selectGasTheDayOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
@Select ( { " select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.tota l_price) end price," +
" case when SUM(a.gas_refuel_price) is null then 0 else SUM(a.gas_refue l_price) end price," +
" count(1) count" +
" count(1) count" +
" from high_child_order a,high_order b " +
" from high_gas_order a where a.gas_staff_id = #{gasStaffId} and a.status in (${status}) " +
" where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) " +
" and to_days(pay_time) = to_days(now())" } )
" and to_days(pay_time) = to_days(now())" } )
Map < String , Object > selectGasStaffTheDayOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
Map < String , Object > selectGasStaffTheDayOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
@Select ( { " select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.tota l_price) end price," +
" case when SUM(a.gas_refuel_price) is null then 0 else SUM(a.gas_refue l_price) end price," +
" count(1) count" +
" count(1) count" +
" from high_child_order a,high_order b " +
" from high_gas_order a where store_id = #{storeId} and a.status in (${status}) " } )
" where a.order_id = b.id and goods_type = 3 and goods_id = #{storeId} and b.order_status in (${status}) " } )
Map < String , Object > selectGasHistoryOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
Map < String , Object > selectGasHistoryOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
@Select ( { " select" +
" case when SUM(b.total_price) is null then 0 else SUM(b .total_price) end price," +
" case when SUM(a.total_price) is null then 0 else SUM(a .total_price) end price," +
" count(1) count" +
" count(1) count" +
" from high_child_order a,high_order b " +
" from high_gas_order a where a.gas_staff_id = #{gasStaffId} and a.status in (${status}) " } )
" where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) " } )
Map < String , Object > selectGasStaffHistoryOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
Map < String , Object > selectGasStaffHistoryOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
@Select ( {
@Select ( {
"<script> " +
"<script> " +
" select" +
" select" +
" b.id orderId," +
" case when sum(b.gas_refuel_price) is not null then sum(b.gas_refuel_price) else 0 end refuelPrice," +
" b.order_no orderNo," +
" a.gas_order_no gasOrderNo," +
" b.mem_discount_name memDiscountName," +
" b.pay_type payType," +
" b.total_price totalPrice," +
" b.deduction_price deductionPrice," +
" b.payable_price payablePrice," +
" b.pay_gold payGold," +
" b.pay_real_price payRealPrice," +
" b.order_status status," +
" REPLACE(b.mem_phone, SUBSTR(b.mem_phone,4,4), '****') merPhone," +
" a.goods_name gasName," +
" (select address from high_merchant_store where id = a.goods_id) gasAddress," +
" a.goods_img gasLogo," +
" a.gas_oil_type gasOilType," +
" a.gas_oil_no gasOilNo," +
" a.gas_gun_no gasGunNo," +
" a.gas_staff_name gasStaffName," +
" a.gas_price_gun gasPriceGun," +
" a.gas_oil_liters gasOilLiters," +
" a.gas_discount gasDiscount," +
" a.gas_oil_subsidy gasOilSubsidy," +
" a.gas_liters_preferences gasLitersPreferences," +
" a.gas_price_preferences gasPricePreferences," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.refund_time refundTime," +
" b.refund_price refundPrice," +
" b.refund_content refundContent," +
" b.print_status printStatus," +
" b.print_num printNum" +
" from high_child_order a,high_order b " +
" where a.order_id = b.id " +
" and goods_type = 3 " +
"<if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
"<if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
"<if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" +
"<if test='param.status != null'> and b.order_status in (${param.status})</if>" +
"<if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>" ,
"<if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>" ,
"<if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>" ,
"<if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>" ,
"<if test='param.orderNo != null'> and b.order_no LIKE concat('%', #{param.orderNo}, '%')</if>" +
" ORDER BY create_time desc" +
"</script>"
} )
List < GasOrderModel > selectGasStoreOrderList ( @Param ( "param" ) Map < String , Object > param ) ;
@Select ( {
"<script> " +
" select" +
" case when sum(b.total_price) is not null then sum(b.total_price) else 0 end refuelPrice," +
" count(1) refuelNum," +
" count(1) refuelNum," +
" case when sum(a.gas_oil_liters) is not null then sum(a.gas_oil_liters) else 0 end refuelLiters" +
" case when sum(a.gas_oil_liters) is not null then sum(a.gas_oil_liters) else 0 end refuelLiters" +
" from high_child_order a,high_order b " +
" from high_gas_order a" +
" where a.order_id = b.id " +
" where " +
" and goods_type = 3 " +
" <if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
" <if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
" <if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
" <if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
" <if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" +
" <if test='param.gasOilNo != null'> and a.gas_oil_no = #{param.gasOilNo}</if>" +
@ -1286,6 +1175,7 @@ public interface HighOrderMapperExt {
} )
} )
List < HighOrder > integralRebateOrder ( ) ;
List < HighOrder > integralRebateOrder ( ) ;
@Select ( { "<script>" +
@Select ( { "<script>" +
"SELECT" +
"SELECT" +
" ho.id as orderId ," +
" ho.id as orderId ," +
@ -1313,5 +1203,4 @@ public interface HighOrderMapperExt {
"</script>"
"</script>"
} )
} )
List < ApiThirdOrderModel > getApiThirdOrderByList ( @Param ( "map" ) Map < String , Object > map ) ;
List < ApiThirdOrderModel > getApiThirdOrderByList ( @Param ( "map" ) Map < String , Object > map ) ;
}
}