package com.hai.dao ;
import com.hai.entity.HighOrder ;
import com.hai.model.* ;
import org.apache.ibatis.annotations.Param ;
import org.apache.ibatis.annotations.Result ;
import org.apache.ibatis.annotations.Results ;
import org.apache.ibatis.annotations.Select ;
import org.apache.ibatis.type.JdbcType ;
import java.math.BigDecimal ;
import java.util.List ;
import java.util.Map ;
/ * *
* mapper扩展类
* /
public interface HighOrderMapperExt {
@Select ( { "SELECT * FROM high_order ho WHERE TIMESTAMPDIFF(MINUTE,ho.create_time,SYSDATE()) > 15 AND ho.order_status = 1" } )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > getCloseOrder ( ) ;
@Select ( { "select distinct * from high_order a left join high_child_order b on a.id = b.order_id where order_status in (1,2) and goods_type in (4,9,10) group by a.id;" } )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_card_id" , property = "memCardId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_card_type" , property = "memCardType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "mem_card_no" , property = "memCardNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "deduction_price" , property = "deductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "refund_price" , property = "refundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "refund_content" , property = "refundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refusal_refund_content" , property = "refusalRefundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "Identification_code" , property = "identificationCode" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "profit_sharing_status" , property = "profitSharingStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "profit_sharing_ratio" , property = "profitSharingRatio" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "account_merchant_num" , property = "accountMerchantNum" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "print_status" , property = "printStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "print_num" , property = "printNum" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "region_id" , property = "regionId" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > getThirdOrder ( ) ;
@Select ( {
"<script>" ,
"select" ,
"coupon_code_id, child_order_id, goods_name , giveaway_type , order_no,mem_name,mem_phone,pay_model,a.pay_type as pay_type, coupon.merchant_id as merchant_id, store_id,pay_gold,pay_price,pay_real_price, " ,
"pay_serial_no,order_status,total_price,a.create_time as create_time ,order_id,company_id, goods_type " ,
"from high_coupon coupon join ( select * from high_order od " ,
"join (select cc.id as coupon_code_id, co.goods_name , co.giveaway_type , cc.child_order_id, merchant_id,coupon_id,order_id,store_id, goods_type " ,
"from high_coupon_code cc join high_child_order co on cc.child_order_id = co.id) cocc on cocc.order_id = od.id " ,
") a on coupon.id = a.coupon_id " ,
"where " ,
"1 = 1 " ,
"<if test='map.companyId != null'> AND company_id = #{map.companyId} </if>" ,
"<if test='map.merchantId != null'> AND merchant_id = #{map.merchantId} </if>" ,
"<if test='map.storeId != null'> AND store_id = #{map.storeId} </if>" ,
"<if test='map.memPhone != null'> AND mem_phone = #{map.memPhone} </if>" ,
"<if test='map.orderNo != null'> AND order_no = #{map.orderNo} </if>" ,
"<if test='map.payModel != null'> AND pay_model = #{map.payModel} </if>" ,
"<if test='map.payType != null'> AND pay_type = #{map.payType} </if>" ,
"<if test='map.orderStatus != null'> AND order_status = #{map.orderStatus} </if>" ,
" order by create_time desc " ,
"</script>"
} )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "goods_name" , property = "goodsName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "giveaway_type" , property = "giveawayType" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "child_order_id" , property = "childOrderId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "company_id" , property = "companyId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "merchant_id" , property = "merchantId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "store_id" , property = "storeId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "goods_type" , property = "goodsType" , jdbcType = JdbcType . INTEGER ) ,
} )
List < HighOrderData > selectOrderDataList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { "<script>" +
" SELECT" +
" (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, " +
" 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 = 1" +
" and a.giveaway_type = 0" +
" and EXISTS (select 1 from high_coupon c where c.id = a.goods_id " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.memDiscountName != null'> and c.coupon_name = #{map.memDiscountName} </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.memPhone != null'> and b.mem_phone = #{map.memPhone} </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 > 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," +
" a.total_price goodsTotalPrice," +
" a.goods_actual_price goodsActualPrice," +
" a.sale_count saleCount," +
" 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 = 4" +
" 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 > selectKfcOrderList ( @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 = 5" +
" 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 > selectCinemaOrderList ( @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 = 6" +
" 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 > getMobileOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { "<script>" +
" SELECT" +
" (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, " +
" 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.giveaway_type = 0" +
" and b.Identification_code = #{map.identificationCode}" +
" <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.memDiscountName != null'> and a.goods_name = #{map.memDiscountName} </if>" +
" <if test='map.memPhone != null'> and b.mem_phone = #{map.memPhone} </if>" +
" <if test='map.payType != null'> and b.pay_type = #{map.payType} </if>" +
" <if test='map.memPhone != null'> and b.mem_phone = #{map.memPhone} </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 > getOrderListByIdCode ( @Param ( "map" ) Map < String , Object > map ) ;
/ * *
* 查询处于已经支付和待支付的话费订单
* /
@Select ( { "SELECT" +
" b.*" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.goods_type = 6" +
" and b.order_status in (1,2) " +
" and a.giveaway_type = 0" +
" GROUP BY b.id" } )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "deduction_price" , property = "deductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "refund_price" , property = "refundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "refund_content" , property = "refundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refusal_refund_content" , property = "refusalRefundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > selectAlreadyPaidMobileOrder ( ) ;
/ * *
* 查询处于已经支付和待支付的KFC订单
* /
@Select ( { "SELECT " +
" b.*" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.goods_type = 4" +
" and b.order_status in (1,2) " +
" and a.giveaway_type = 0" +
" GROUP BY b.id" } )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "deduction_price" , property = "deductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "refund_price" , property = "refundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "refund_content" , property = "refundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refusal_refund_content" , property = "refusalRefundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > selectAlreadyPaidKfcOrder ( ) ;
/ * *
* 查询处于已经支付和待支付的电影票订单
* /
@Select ( { "SELECT" +
" b.*" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.goods_type = 5" +
" and b.order_status in (1,2)" +
" and a.giveaway_type = 0" +
" GROUP BY b.id" } )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "deduction_price" , property = "deductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "refund_price" , property = "refundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "refund_content" , property = "refundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refusal_refund_content" , property = "refusalRefundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > selectAlreadyPaidCinemaOrder ( ) ;
@Select ( "select a.id,a.order_no,TRIM(BOTH '\"' FROM b.transaction_id) pay_serial_no from " +
"(select id,order_no from high_order where order_status = 5 and create_time >= '2021-06-21 00:00:00') a" +
"LEFT JOIN (select JSON_EXTRACT(body_info,'$.out_trade_no') out_trade_no,JSON_EXTRACT(body_info,'$.transaction_id') transaction_id from high_pay_record where create_time >= '2021-06-21 00:00:00' and res_type = 2 GROUP BY JSON_EXTRACT(body_info,'$.out_trade_no')) b on a.order_no = b.out_trade_no where b.out_trade_no is not null" )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_model" , property = "payModel" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "deduction_price" , property = "deductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "refund_price" , property = "refundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "refund_content" , property = "refundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refusal_refund_content" , property = "refusalRefundContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > selectTest ( ) ;
@Select ( { "select a.id orderId,b.id childOrderId from high_order a,high_child_order b where a.id = b.order_id and b.goods_type = 3 and a.order_status = 2 and TIMESTAMPDIFF(MINUTE,a.pay_time,SYSDATE()) > 60*24 GROUP BY b.id" } )
List < Map < String , Object > > selectFinishGasOrder ( ) ;
@Select ( { "<script>" +
" SELECT" +
" op.pre_order_no preOrderNo , " +
" op.order_no orderNo , " +
" op.pay_real_price payRealPrice , " +
" op.goods_name goodsName , " +
" op.pre_user_name preUserName , " +
" op.pre_user_phone preUserPhone , " +
" op.pre_user_remark preUserRemark , " +
" op.status_fail_desc statusFailDesc , " +
" op.reach_time reachTime , " +
" op.reach_address reachAddress , " +
" ms.store_name storeName , " +
" ms.address address , " +
" op.create_time createTime , " +
" case op.status when 1 then '预约中' when 2 then '预约成功' when 3 then '预约完成' when 4 then '预约失败' end status" +
" FROM" +
" high_order_pre op join high_merchant_store ms on op.merchant_store_id = ms.id " +
" WHERE" +
" 1=1" +
" <if test='map.companyId != null'> and op.company_id = #{map.companyId} </if> " +
" <if test='map.merchantStoreId != null'> and op.merchant_store_id = #{map.merchantStoreId} </if>" ,
" <if test='map.merchantId != null'> and op.merchant_id = #{map.merchantId} </if> " +
" <if test='map.orderNo != null'> and op.order_no = #{map.orderNo}</if>" ,
" <if test='map.preOrderNo != null'> and op.pre_order_no = #{map.preOrderNo} </if>" ,
" <if test='map.pre_user_name != null'> and op.pre_user_name = #{map.pre_user_name} </if>" ,
" <if test='map.pre_user_phone != null'> and op.preUserName = #{map.pre_user_phone} </if>" ,
" <if test='map.goods_name != null'> and op.goodsName = #{map.goods_name} </if>" ,
" <if test='map.status != null'> and op.status = #{map.status} </if>" ,
" <if test='map.createTimeS != null'> <![CDATA[ and op.create_time >= #{map.createTimeS} ]]> </if>" ,
" <if test='map.createTimeE != null'> <![CDATA[ and op.create_time <= #{map.createTimeE} ]]> </if>" ,
" ORDER BY op.create_time desc" +
"</script>" } )
List < HighOrderPreModel > ExportPreOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { "<script>" +
" SELECT" +
" (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 '加油缴费' when 4 then 'KFC' when 5 then '电影票' when 6 then '话费充值' when 7 then '优惠券包' when 8 then '汇联通充值' end goodsType, " +
" 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.giveaway_type = 0" +
" and EXISTS (select 1 from high_coupon c where c.id = a.goods_id " +
" <if test='map.goodsType != null'> and a.goods_type = #{map.goodsType} </if> " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.memDiscountName != null'> and c.coupon_name = #{map.memDiscountName} </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.memPhone != null'> and b.mem_phone = #{map.memPhone} </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 > selectDiscountPackageOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select sum(total_price) orderPrice, sum(pay_real_price) payRealPrice , count(*) count " ,
"from high_order where order_status in (2,3) and pay_type = 4 and Identification_code = #{code} " ,
"</script>"
} )
@Results ( {
@Result ( column = "payPrice" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "orderPrice" , property = "orderPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "count" , property = "count" , jdbcType = JdbcType . BIGINT ) ,
} )
OrderCountModel orderByIndex ( Integer code ) ;
@Select ( value = {
"<script>" ,
"select sum(b.total_price) orderPrice, sum(b.pay_price) payRealPrice, count(*) count " ,
"FROM high_order b join high_child_order a on b.id = a.order_id WHERE a.order_id = b.id and a.giveaway_type = 0 and b.Identification_code = 60 and b.pay_type in (1, 2, 3, 5) and b.order_status in (2, 3)and a.goods_type in (1, 8) and Identification_code = #{code} " ,
"</script>"
} )
@Results ( {
@Result ( column = "payRealPrice" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "orderPrice" , property = "orderPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "count" , property = "count" , jdbcType = JdbcType . BIGINT ) ,
} )
OrderCountModel HLTOrderByIndex ( Integer code ) ;
@Select ( { "<script>" +
" SELECT" +
" (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 '加油缴费' when 4 then 'KFC' when 5 then '电影票' when 6 then '话费充值' when 7 then '优惠券包' when 8 then '汇联通充值' end goodsType, " +
" 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.giveaway_type = 0" +
" and b.Identification_code = #{map.identificationCode}" +
" and b.pay_type in (1,2,3,5)" +
" and b.order_status in (2,3)" +
" and b.order_status in (2,3)" +
" and a.goods_type in (1, 8)" +
" <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.memDiscountName != null'> and a.goods_name = #{map.memDiscountName} </if>" +
" <if test='map.memPhone != null'> and b.mem_phone = #{map.memPhone} </if>" +
" <if test='map.memPhone != null'> and b.mem_phone = #{map.memPhone} </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 > selectOrderList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select sum(pay_real_price) from high_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" order_status in (2,3) " ,
"</script>" } )
BigDecimal orderPriceTotal ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select sum(pay_real_price) from out_recharge_order where" +
" <if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" pay_status in (102,100) " ,
"</script>"
} )
BigDecimal rechargePriceTotal ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(pay_real_price) from high_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
" order_status in (2,3) " ,
"</script>"
} )
Long orderPriceCount ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(pay_real_price) from out_recharge_order where " +
"<if test='map.today != null'> to_days(pay_time) = to_days(now()) and </if> " +
"pay_status in (102,100) " ,
"</script>"
} )
Long rechargePriceCount ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select a.click_date as datetime, " +
"ifnull(b.num,0) as price " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_time) as datetime, " +
"sum(pay_real_price) as num " +
"from high_order where order_status in (2,3)" +
"group by date(create_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC " ,
"</script>"
} )
List < OrderSumModel > getOrderSumOrderByDate ( ) ;
@Select ( value = {
"<script>" ,
"select a.click_date as datetime, " +
"ifnull(b.num,0) as price " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_timed) as datetime, " +
"sum(pay_real_price) as num " +
"from out_recharge_order where pay_status in (102,100)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC " ,
"</script>"
} )
List < OrderSumModel > getOrderSumRechargeByDate ( ) ;
@Select ( value = {
"<script>" ,
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_time) as datetime, " +
"count(*) as num " +
"from high_order where order_status in (2,3)" +
"group by date(create_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC " ,
"</script>"
} )
List < DateCountModel > getDateCountByOrder ( ) ;
@Select ( value = {
"<script>" ,
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(create_timed) as datetime, " +
"count(*) as num " +
"from out_recharge_order where pay_status in (102,100)" +
"group by date(create_timed) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC " ,
"</script>"
} )
List < DateCountModel > getDateCountByRecharge ( ) ;
@Select ( value = {
"<script>" ,
"select a.click_date as datetime, " +
"ifnull(b.num,0) as num " +
"from ( " +
"SELECT curdate() as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 1 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 2 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 3 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 4 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 5 day) as click_date " +
"union all " +
"SELECT date_sub(curdate(), interval 6 day) as click_date " +
") a " +
"left join ( " +
"select date(reg_time) as datetime, " +
"count(*) as num " +
"from high_user " +
"group by date(reg_time) " +
") b " +
"on a.click_date = b.datetime " +
"ORDER BY a.click_date ASC " ,
"</script>"
} )
List < DateCountModel > getDateCountByUser ( ) ;
@Select ( { "select count(1) from high_order " +
"where id in (select b.order_id from high_child_order b where goods_type = 3 and mem_id = #{userId} and child_orde_status in (2,3)) " +
"and year(pay_time)=year(now()) and month(pay_time) = month(now()) and day(pay_time) = day(now())" } )
int selectGasTheDayOrderNum ( @Param ( "userId" ) Long userId ) ;
@Select ( value = {
"<script>" ,
"select sum(pay_real_price) as tradePrice,sum(deduction_price) as discountedPrice,sum(total_price) as orderPrice " ,
"from " ,
"(select pay_price, pay_real_price, deduction_price, ho.total_price as total_price 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) " ,
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </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.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " +
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </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.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> " ,
") as hh; " ,
"</script>"
} )
@Results ( {
@Result ( column = "tradePrice" , property = "tradePrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "discountedPrice" , property = "discountedPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "orderPrice" , property = "orderPrice" , jdbcType = JdbcType . DECIMAL ) ,
} )
TyOrderCountModel TyOrderCount ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(total_price) " ,
"from " ,
"(select pay_price, pay_real_price, deduction_price, ho.total_price as total_price 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) " ,
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </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.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " +
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </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.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> " ,
") as hh; " ,
"</script>"
} )
int TyOrderNum ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(total_price) " ,
"from " ,
"(select pay_price, pay_real_price, deduction_price, ho.total_price as total_price 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) " ,
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </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.goodsId != null'> and hco.goods_id = #{map.goodsId} </if> " ,
"<if test='map.totalPrice != null'> <![CDATA[ and ho.total_price < #{map.totalPrice} ]]> </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </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.orgId != null'> and hco.gas_org_id = #{map.orgId} </if> " ,
"<if test='map.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> " ,
") as hh; " ,
"</script>"
} )
int TyOrderNumByPrice ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(*) as value , " +
"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 " ,
"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.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.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.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.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " ,
"group by pay_type " ,
"</script>"
} )
@Results ( {
@Result ( column = "value" , property = "value" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "name" , property = "name" , jdbcType = JdbcType . VARCHAR ) ,
} )
List < TyOrderGorpModel > TyOrderNumGroupByPayType ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( value = {
"<script>" ,
"select count(*) as value , hco.gas_oil_no as name 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) " ,
"<if test='map.payType != null'> and ho.pay_type = #{map.payType} </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.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.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.agentId != null'> and hco.gas_agent_id = #{map.agentId} </if> " ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if> " ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if> " ,
"group by hco.gas_oil_no " ,
"</script>"
} )
@Results ( {
@Result ( column = "value" , property = "value" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "name" , property = "name" , jdbcType = JdbcType . VARCHAR ) ,
} )
List < TyOrderGorpModel > TyOrderNumGroupByGasOilNo ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( { " select" +
" case when SUM(gas_refuel_price) is null then 0 else SUM(gas_refuel_price) end price," +
" count(1) count" +
" from high_gas_order where store_id = #{storeId} and status in (${status}) " +
" and to_days(pay_time) = to_days(now())" } )
Map < String , Object > selectGasTheDayOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
" case when SUM(a.gas_refuel_price) is null then 0 else SUM(a.gas_refuel_price) end price," +
" count(1) count" +
" from high_gas_order a where a.gas_staff_id = #{gasStaffId} and a.status in (${status}) " +
" and to_days(pay_time) = to_days(now())" } )
Map < String , Object > selectGasStaffTheDayOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
" case when SUM(a.gas_refuel_price) is null then 0 else SUM(a.gas_refuel_price) end price," +
" count(1) count" +
" from high_gas_order a where store_id = #{storeId} and a.status in (${status}) " } )
Map < String , Object > selectGasHistoryOrderCount ( @Param ( "storeId" ) Long storeId , @Param ( "status" ) String status ) ;
@Select ( { " select" +
" case when SUM(a.total_price) is null then 0 else SUM(a.total_price) end price," +
" count(1) count" +
" from high_gas_order a where a.gas_staff_id = #{gasStaffId} and a.status in (${status}) " } )
Map < String , Object > selectGasStaffHistoryOrderCount ( @Param ( "gasStaffId" ) Long gasStaffId , @Param ( "status" ) String status ) ;
@Select ( {
"<script> " +
" select" +
" case when sum(b.gas_refuel_price) is not null then sum(b.gas_refuel_price) else 0 end refuelPrice," +
" count(1) refuelNum," +
" case when sum(a.gas_oil_liters) is not null then sum(a.gas_oil_liters) else 0 end refuelLiters" +
" from high_gas_order a" +
" where " +
" <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>"
} )
Map < String , Object > countGasStoreOrder ( @Param ( "param" ) Map < String , Object > param ) ;
@Select ( {
"<script>" ,
"select" ,
"order_no , goods_name as oil_station_name , gas_staff_name , gas_oil_type , gas_oil_no ,gas_gun_no , gas_price_official , gas_price_gun , gas_oil_liters , b.total_price as gas_price , mem_phone as user_phone , pay_time ,create_time , order_status " ,
"from high_order a join high_child_order b on a.id = b.order_id where " ,
" b.goods_id in (${goodsId}) " ,
" group by a.order_no " ,
"</script>"
} )
@Results ( {
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "oil_station_name" , property = "oilStationName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "gas_staff_name" , property = "gasStaffName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "gas_oil_type" , property = "gasOilType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "gas_oil_no" , property = "gasOilNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "gas_gun_no" , property = "gasGunNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "gas_price_official" , property = "gasPriceOfficial" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "gas_price_gun" , property = "gasPriceGun" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "gas_oil_liters" , property = "gasOilLiters" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "gas_price" , property = "gasPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "user_phone" , property = "userPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
} )
List < SelfOilStationModel > getSelfOilStationOrderList ( @Param ( "goodsId" ) String goodsId ) ;
@Select ( "select ho.* from high_order ho left join bs_order_rebate bor on ho.id = bor.order_id where bor.id is null and order_status = 3 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false and ho.create_time > '2023-02-01 00:00:00' group by create_time desc;" )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "title" , property = "title" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "search_title" , property = "searchTitle" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "product_type" , property = "productType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "company_id" , property = "companyId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "company_name" , property = "companyName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "promote_code" , property = "promoteCode" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "mem_card_id" , property = "memCardId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_card_type" , property = "memCardType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "mem_card_no" , property = "memCardNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "total_deduction_price" , property = "totalDeductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "deduction_coupon_price" , property = "deductionCouponPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "deduction_product_price" , property = "deductionProductPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "payable_price" , property = "payablePrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "surplus_refund_price" , property = "surplusRefundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "surplus_refund_integral" , property = "surplusRefundIntegral" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "account_merchant_num" , property = "accountMerchantNum" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "profit_sharing_status" , property = "profitSharingStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "profit_sharing_record_id" , property = "profitSharingRecordId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "whether_check" , property = "whetherCheck" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "whether_rebate" , property = "whetherRebate" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "exception_status" , property = "exceptionStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "exception_content" , property = "exceptionContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_4" , property = "ext4" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_5" , property = "ext5" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_6" , property = "ext6" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > integralRebateOrder ( ) ;
@Select ( { "<script>" +
"SELECT" +
" ho.id as orderId ," +
" aor.order_no as orderNo ," +
" source_order_no as sourceOrderNo ," +
" ho.total_price as orderPrice ," +
" ho.pay_price as payPrice ," +
" ho.order_status as orderStatus ," +
" aor.status as callbackStatus ," +
" ho.create_time as createTime ," +
" ho.pay_time as payTime" +
" from high_order ho join api_order_record aor on ho.id = aor.order_id " +
" where 1 = 1 " +
"<if test='map.merchId != null'> and merch_id = #{map.merchId} </if>" ,
"<if test='map.orderNo != null'> and aor.order_no = #{map.orderNo} </if>" ,
"<if test='map.sourceOrderNo != null'> and aor.source_order_no = #{map.sourceOrderNo} </if>" ,
"<if test='map.orderStatus != null'> and order_status = #{map.orderStatus} </if>" ,
"<if test='map.productType != null'> and ho.product_type = #{map.productType} </if>" ,
"<if test='map.callbackStatus != null'> and aor.status = #{map.callbackStatus} </if>" ,
"<if test='map.createTimeS != null'> <![CDATA[ and ho.create_time >= #{map.createTimeS} ]]> </if>" ,
"<if test='map.createTimeE != null'> <![CDATA[ and ho.create_time <= #{map.createTimeE} ]]> </if>" ,
"<if test='map.payTimeS != null'> <![CDATA[ and ho.pay_time >= #{map.payTimeS} ]]> </if>" ,
"<if test='map.payTimeE != null'> <![CDATA[ and ho.pay_time <= #{map.payTimeE} ]]> </if>" ,
" ORDER BY ho.create_time DESC" +
"</script>"
} )
List < ApiThirdOrderModel > getApiThirdOrderByList ( @Param ( "map" ) Map < String , Object > map ) ;
@Select ( "SELECT * FROM high_order WHERE create_time < NOW()-INTERVAL 3 day and product_type = 9 and order_status = 2 group by create_time asc;" )
@Results ( {
@Result ( column = "id" , property = "id" , jdbcType = JdbcType . BIGINT , id = true ) ,
@Result ( column = "title" , property = "title" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "search_title" , property = "searchTitle" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "product_type" , property = "productType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "company_id" , property = "companyId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "company_name" , property = "companyName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "promote_code" , property = "promoteCode" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_discount_id" , property = "memDiscountId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_discount_name" , property = "memDiscountName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_id" , property = "memId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_name" , property = "memName" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "mem_phone" , property = "memPhone" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "order_no" , property = "orderNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_serial_no" , property = "paySerialNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "pay_type" , property = "payType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "mem_card_id" , property = "memCardId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "mem_card_type" , property = "memCardType" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "mem_card_no" , property = "memCardNo" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "total_price" , property = "totalPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "total_deduction_price" , property = "totalDeductionPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "deduction_coupon_price" , property = "deductionCouponPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "deduction_product_price" , property = "deductionProductPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_gold" , property = "payGold" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "payable_price" , property = "payablePrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_price" , property = "payPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "pay_real_price" , property = "payRealPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "order_status" , property = "orderStatus" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "remarks" , property = "remarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "create_time" , property = "createTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "surplus_refund_price" , property = "surplusRefundPrice" , jdbcType = JdbcType . DECIMAL ) ,
@Result ( column = "surplus_refund_integral" , property = "surplusRefundIntegral" , jdbcType = JdbcType . INTEGER ) ,
@Result ( column = "pay_time" , property = "payTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "finish_time" , property = "finishTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_time" , property = "cancelTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "cancel_remarks" , property = "cancelRemarks" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "refund_time" , property = "refundTime" , jdbcType = JdbcType . TIMESTAMP ) ,
@Result ( column = "account_merchant_num" , property = "accountMerchantNum" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "profit_sharing_status" , property = "profitSharingStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "profit_sharing_record_id" , property = "profitSharingRecordId" , jdbcType = JdbcType . BIGINT ) ,
@Result ( column = "whether_check" , property = "whetherCheck" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "whether_rebate" , property = "whetherRebate" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "exception_status" , property = "exceptionStatus" , jdbcType = JdbcType . BIT ) ,
@Result ( column = "exception_content" , property = "exceptionContent" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_1" , property = "ext1" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_2" , property = "ext2" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_3" , property = "ext3" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_4" , property = "ext4" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_5" , property = "ext5" , jdbcType = JdbcType . VARCHAR ) ,
@Result ( column = "ext_6" , property = "ext6" , jdbcType = JdbcType . VARCHAR )
} )
List < HighOrder > phoneErrorOrder ( ) ;
}