|
|
|
package com.hai.dao;
|
|
|
|
|
|
|
|
import com.hai.entity.HighOrder;
|
|
|
|
import com.hai.model.HighOrderData;
|
|
|
|
import com.hai.model.HighOrderModel;
|
|
|
|
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.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({
|
|
|
|
"<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" +
|
|
|
|
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' end goodsType, " +
|
|
|
|
" a.goods_name goodsName, " +
|
|
|
|
" 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 '金币' end payType, " +
|
|
|
|
" b.pay_serial_no paySerialNo," +
|
|
|
|
" b.total_price totalPrice," +
|
|
|
|
" b.mem_discount_name memDiscountName," +
|
|
|
|
" b.deduction_price deductionPrice," +
|
|
|
|
" case when b.pay_gold is null then 0 else pay_gold end payGold," +
|
|
|
|
" b.pay_price payPrice," +
|
|
|
|
" b.pay_real_price payRealPrice, " +
|
|
|
|
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' end orderStatus, " +
|
|
|
|
" b.create_time createTime," +
|
|
|
|
" b.pay_time payTime," +
|
|
|
|
" b.cancel_time cancelTime" +
|
|
|
|
" FROM" +
|
|
|
|
" high_child_order a," +
|
|
|
|
" high_order b" +
|
|
|
|
" WHERE" +
|
|
|
|
" a.order_id = b.id" +
|
|
|
|
" and a.goods_type = 1" +
|
|
|
|
" and a.giveaway_type = 0" +
|
|
|
|
"<if test='map.companyId != null'> and EXISTS (select 1 from high_coupon c where c.company_id = #{map.companyId} and c.id = a.goods_id)</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.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);
|
|
|
|
|
|
|
|
}
|