嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java

282 lines
20 KiB

package com.hai.dao;
import com.hai.entity.HighOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargeOrderExample;
import com.hai.model.*;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface OutRechargeOrderMapperExt {
@Select(value = {
"<script>",
"SELECT DATE_FORMAT(create_timed, '%Y-%m-%d') as day,",
"count(1) as count,",
"sum(pay_price) as pay_price,",
"sum(order_price) as order_price,",
"`pay_status`",
"from out_recharge_order",
"where ",
" create_timed between #{finishTimeS} and #{finishTimeE} " ,
"<if test='status != null'> and pay_status = #{status} </if>",
"GROUP BY day",
"</script>"
})
@Results({
@Result(column="count", property="count", jdbcType=JdbcType.BIGINT),
@Result(column="day", property="day", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
})
List<OutOrderModel> getListOrderCount(String finishTimeS , String finishTimeE , Integer status);
@Select(value = {
"<script>",
"select agent_name, count(1) as count, sum(pay_price) as pay_price",
"from high_agent ha",
"right join out_recharge_order oro on ha.agent_key = oro.agent_key",
"where ha.type = 2 and oro.status in (3)",
" and finish_time between #{finishTimeS} and #{finishTimeE} " ,
"GROUP BY agent_name",
"</script>"
})
@Results({
@Result(column="count", property="count", jdbcType=JdbcType.BIGINT),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
})
List<OutUserOrderModel> getListUserCount(String finishTimeS , String finishTimeE);
@Select({"<script>" +
"SELECT" +
" order_no as orderNo," +
" operator_name as operatorName," +
" labor_union_card as laborUnionCard," +
" refund_time as refundTime," +
" create_timed as createTime," +
" case recharge_type when 1 then '快充' when 2 then '慢充' end rechargeTypeName ," +
" case pay_type when 2 then '微信支付' when 3 then '工会卡支付' when 4 then '银联支付' when null then '积分抵扣' end payTypeName," +
" recharge_content as rechargeContent,recharge_price as rechargePrice,pay_price as payPrice,discount_deduction_price as discountDeductionPrice,integral_deduction_price as integralDeductionPrice,pay_real_price as payRealPrice," +
" user_name as userName, user_phone as userPhone, create_timed as createTimed, pay_time as payTime," +
" case pay_status when 100 then '已完成' when 101 then '待支付' when 102 then '已支付' when 104 then '已取消' when 105 then '已退款' end payStatusName," +
" case recharge_status when 201 then '充值中' when 202 then '充值成功' when 203 then '充值失败' when 204 then '未充值' end rechargeStatusName" +
" FROM" +
" out_recharge_order a where 1 = 1 " +
"<if test='map.companyId != null'> and `company_id` = #{map.companyId} </if>",
"<if test='map.payType != null'> and `pay_type` = #{map.payType} </if>",
"<if test='map.rechargeStatus != null'> and `recharge_status` = #{map.rechargeStatus} </if>",
"<if test='map.payStatus != null'> and `pay_status` = #{map.payStatus} </if>",
"<if test='map.orderNo != null'> and `order_no` = #{map.orderNo} </if>",
"<if test='map.rechargeType != null'> and `recharge_type` = #{map.rechargeType} </if>",
"<if test='map.operatorType != null'> and `operator_type` = #{map.operatorType} </if>",
"<if test='map.rechargeContent != null'> and `recharge_content` LIKE '%${map.rechargeContent}%' </if>",
"<if test='map.laborUnionCard != null'> and `labor_union_card` LIKE '%${map.laborUnionCard}%' </if>",
"<if test='map.userPhone != null'> and `user_phone` = #{map.userPhone} </if>",
"<if test='map.createTimeS != null'> <![CDATA[ and create_timed >= #{map.createTimeS} ]]> </if>",
"<if test='map.createTimeE != null'> <![CDATA[ and create_timed <= #{map.createTimeE} ]]> </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and pay_time <= #{map.payTimeE} ]]> </if>",
" ORDER BY" +
" a.create_timed DESC " +
"</script>"
})
List<OutRechargeOrderModel> selectOrderCount(@Param("map") Map<String,Object> map);
@Select({"SELECT * FROM out_recharge_order ho WHERE TIMESTAMPDIFF(MINUTE,ho.create_timed,SYSDATE()) > 15 AND ho.pay_status = 101"})
@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="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_model", property="rechargeModel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", 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="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
@Result(column="create_timed", property="createTimed", 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="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT)
})
List<OutRechargeOrder> getCloseOrder();
@Select(value = {
"<script>",
"select sum(order_price) orderPrice, sum(pay_real_price) payRealPrice , count(*) count ",
"from out_recharge_order where pay_status in (102,100) and company_id = 23",
"</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 rechargeOrderByIndex(Integer code);
@Select("select * from out_recharge_order where recharge_status = 202 and pay_status = 100 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false group by create_timed desc ; ")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="operator_type", property="operatorType", jdbcType=JdbcType.INTEGER),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT),
@Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="labor_union_card", property="laborUnionCard", jdbcType=JdbcType.VARCHAR),
@Result(column="integral_num", property="integralNum", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_deduction_price", property="discountDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="integral_deduction_price", property="integralDeductionPrice", jdbcType=JdbcType.DECIMAL),
@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="create_timed", property="createTimed", 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="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="tp_refund_order_no", property="tpRefundOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="merch_id", property="merchId", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
@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="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR),
@Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT)
})
List<OutRechargeOrder> integralRebateRechargeOrder();
@Select({"<script>" +
"SELECT" +
" aor.order_no as orderNo ," +
" source_order_no as sourceOrderNo ," +
" oro.operator_name as operators ," +
" recharge_content as rechargeNumber ," +
" recharge_price as rechargePrice ," +
" pay_price as payPrice ," +
" create_timed as createTimed ," +
" pay_time as payTime ," +
" finish_time as finishTime ," +
" pay_status as payStatus ," +
" recharge_status as rechargeStatus ," +
" aor.status as callbackStatus from" +
" out_recharge_order oro join api_order_record aor on oro.id = aor.order_id " +
" where 1 = 1 " +
"<if test='map.merchId != null'> and merch_id = #{map.merchId} </if>",
"<if test='map.orderNo != null'> and oro.order_no = #{map.orderNo} </if>",
"<if test='map.sourceOrderNo != null'> and aor.source_order_no = #{map.sourceOrderNo} </if>",
"<if test='map.rechargeStatus != null'> and recharge_status = #{map.rechargeStatus} </if>",
"<if test='map.payStatus != null'> and pay_status = #{map.payStatus} </if>",
"<if test='map.callbackStatus != null'> and aor.status = #{map.callbackStatus} </if>",
"<if test='map.operators != null'> and oro.operator_name LIKE '%${map.operators}%' </if>",
"<if test='map.rechargeNumber != null'> and recharge_content LIKE '%${map.rechargeNumber}%' </if>",
"<if test='map.createTimeS != null'> <![CDATA[ and create_timed >= #{map.createTimeS} ]]> </if>",
"<if test='map.createTimeE != null'> <![CDATA[ and create_timed <= #{map.createTimeE} ]]> </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and pay_time <= #{map.payTimeE} ]]> </if>",
" ORDER BY create_timed DESC" +
"</script>"
})
List<ApiRechargePhoneModel> getApiRechargePhoneByList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
"SELECT * FROM out_recharge_order WHERE order_no NOT IN ( SELECT order_no FROM high_order where product_type = 9);" +
"</script>"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="operator_type", property="operatorType", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_no", property="childOrderNo", 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="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="labor_union_card", property="laborUnionCard", jdbcType=JdbcType.VARCHAR),
@Result(column="integral_num", property="integralNum", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_deduction_price", property="discountDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="integral_deduction_price", property="integralDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", 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="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_timed", property="createTimed", 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="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="tp_refund_order_no", property="tpRefundOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="abnormal_msg", property="abnormalMsg", 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="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="merch_id", property="merchId", jdbcType=JdbcType.VARCHAR),
@Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT)
})
List<OutRechargeOrder> selectList();
}