package com.hai.dao ;
import com.hai.entity.HighOrder ;
import com.hai.model.HighOrderData ;
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,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, 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 = "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 ) ;
}