嗨森逛服务
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

105 lines
5.2 KiB

package com.hai.dao;
4 years ago
import com.hai.model.OutOrderModel;
4 years ago
import com.hai.model.OutRechargeOrderModel;
4 years ago
import com.hai.model.OutUserOrderModel;
4 years ago
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;
4 years ago
4 years ago
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface OutRechargeOrderMapperExt {
4 years ago
@Select(value = {
"<script>",
4 years ago
"SELECT DATE_FORMAT(create_timed, '%Y-%m-%d') as day,",
4 years ago
"count(1) as count,",
"sum(pay_price) as pay_price,",
4 years ago
"sum(order_price) as order_price,",
"`status`",
4 years ago
"from out_recharge_order",
4 years ago
"where ",
" create_timed between #{finishTimeS} and #{finishTimeE} " ,
"<if test='status != null'> and status = #{status} </if>",
4 years ago
"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),
4 years ago
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
4 years ago
})
4 years ago
List<OutOrderModel> getListOrderCount(String finishTimeS , String finishTimeE , Integer status);
4 years ago
@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);
4 years ago
4 years ago
@Select({"<script>" +
"SELECT" +
4 years ago
" a.order_no orderNo," +
" a.user_name userName," +
" a.user_phone userPhone," +
3 years ago
" case a.recharge_model when 1 then '电信话费' when 2 then '移动话费' when 3 then '联通话费' end rechargeModelName," +
4 years ago
" a.recharge_content rechargeContent," +
" a.remarks remarks," +
" a.id_card cardNo," +
" a.recharge_name rechargeName," +
3 years ago
" case a.pay_type when 1 then '微信' when 2 then '工会卡' when 3 then '积分' when 4 then '银联' end payTypeName," +
4 years ago
" a.order_price orderPrice," +
" a.pay_price payPrice," +
" a.pay_real_price payRealPrice," +
" case a.status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已取消' when 5 then '已退款' when 6 then '退款中' end statusName," +
4 years ago
" a.create_timed createTime," +
" a.pay_time payTime," +
" a.cancel_time cancelTime," +
" a.finish_time finishTime," +
" a.refund_time refundTime," +
" a.refund_fee refundFee," +
" a.out_refund_no outRefundNo," +
" a.refund_id refundId" +
4 years ago
" FROM" +
" out_recharge_order a where 1 = 1 " +
4 years ago
"<if test='map.status != null'> and a.`status` = #{map.status} </if>",
3 years ago
"<if test='map.payType != null'> and a.`pay_type` = #{map.payType} </if>",
3 years ago
"<if test='map.code != null'> and a.`Identification_code` = #{map.code} </if>",
4 years ago
"<if test='map.orderNo != null'> and a.`order_no` = #{map.orderNo} </if>",
"<if test='map.rechargeModel != null'> and a.`recharge_model` = #{map.rechargeModel} </if>",
"<if test='map.rechargeContent != null'> and a.`recharge_content` LIKE '%${map.rechargeContent}%' </if>",
"<if test='map.idCard != null'> and a.`id_card` LIKE '%${map.idCard}%' </if>",
4 years ago
"<if test='map.userPhone != null'> and a.`user_phone` = #{map.userPhone} </if>",
"<if test='map.createTimeS != null'> <![CDATA[ and a.create_timed >= #{map.createTimeS} ]]> </if>",
"<if test='map.createTimeE != null'> <![CDATA[ and a.create_timed <= #{map.createTimeE} ]]> </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and a.pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and a.pay_time <= #{map.payTimeE} ]]> </if>",
4 years ago
" ORDER BY" +
3 years ago
" a.create_timed DESC " +
4 years ago
"</script>"
4 years ago
})
4 years ago
List<OutRechargeOrderModel> selectOrderCount(@Param("map") Map<String,Object> map);
4 years ago
}