|
|
@@ -49,55 +49,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<sql id="boWhere">
|
|
|
- <if test="bo!=null and bo.currentBusinessName!=null and bo.currentBusinessName!=''">
|
|
|
- and current_business_name like concat('%',#{bo.currentBusinessName},'%')
|
|
|
+
|
|
|
+ <if test="query.bo!=null and query.bo.currentBusinessName!=null and query.bo.currentBusinessName!=''">
|
|
|
+ and current_business_name like concat('%',#{query.bo.currentBusinessName},'%')
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.orderNo!=null and bo.orderNo!=''">
|
|
|
- and order_no like concat('%',#{bo.orderNo},'%')
|
|
|
+ <if test="query.bo!=null and query.bo.orderNo!=null and query.bo.orderNo!=''">
|
|
|
+ and order_no like concat('%',#{query.bo.orderNo},'%')
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.userMobile!=null and bo.userMobile!=''">
|
|
|
- and user_mobile like concat('%',#{bo.userMobile},'%')
|
|
|
+ <if test="query.bo!=null and bo.userMobile!=null and query.bo.userMobile!=''">
|
|
|
+ and user_mobile like concat('%',#{query.bo.userMobile},'%')
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.userName!=null and bo.userName!=''">
|
|
|
- and user_name like concat('%',#{bo.userName},'%')
|
|
|
+ <if test="query.bo!=null and query.bo.userName!=null and query.bo.userName!=''">
|
|
|
+ and user_name like concat('%',#{query.bo.userName},'%')
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.subsidyStatus!=null">
|
|
|
- and subsidy_status = #{bo.subsidyStatus}
|
|
|
+ <if test="query.bo!=null and query.bo.subsidyStatus!=null">
|
|
|
+ and subsidy_status = #{query.bo.subsidyStatus}
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.consumeStartTime!=null">
|
|
|
- and consume_time >= #{bo.consumeStartTime}
|
|
|
+ <if test="query.bo!=null and query.bo.consumeStartTime!=null">
|
|
|
+ and consume_time >= #{query.bo.consumeStartTime}
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.consumeEndTime!=null">
|
|
|
- and consume_time <= #{bo.consumeEndTime}
|
|
|
+ <if test="query.bo!=null and query.bo.consumeEndTime!=null">
|
|
|
+ and consume_time <= #{query.bo.consumeEndTime}
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.queueStartTime!=null">
|
|
|
- and queue_time >= #{bo.queueStartTime}
|
|
|
+ <if test="query.bo!=null and query.bo.queueStartTime!=null">
|
|
|
+ and queue_time >= #{query.bo.queueStartTime}
|
|
|
</if>
|
|
|
- <if test="bo!=null and bo.queueEndTime!=null">
|
|
|
- and queue_time <= #{bo.queueEndTime}
|
|
|
+ <if test="query.bo!=null and query.bo.queueEndTime!=null">
|
|
|
+ and queue_time <= #{query.bo.queueEndTime}
|
|
|
</if>
|
|
|
</sql>
|
|
|
|
|
|
<select id="getSubsidyAmount" resultType="java.math.BigDecimal">
|
|
|
select
|
|
|
- <if test="countType == 1">
|
|
|
+ <if test="query.countType == 1">
|
|
|
IFNULL(sum(actual_subsidy_amount),0)
|
|
|
</if>
|
|
|
- <if test="countType == 2">
|
|
|
+ <if test="query.countType == 2">
|
|
|
IFNULL(sum(subsidy_points),0)
|
|
|
</if>
|
|
|
- <if test="countType == 3">
|
|
|
+ <if test="query.countType == 3">
|
|
|
IFNULL(sum(should_subsidy_amount-actual_subsidy_amount),0)
|
|
|
</if>
|
|
|
from tb_subsidy_queue
|
|
|
<where>
|
|
|
- <if test="businessId != null">
|
|
|
+ <if test="query.businessId != null">
|
|
|
and current_business_id = #{businessId}
|
|
|
</if>
|
|
|
- <if test="countType == 3">
|
|
|
+ <if test="query.businessIds != null and query.businessIds.size>0">
|
|
|
+ and current_business_id in
|
|
|
+ <foreach item="item" collection="query.businessIds" separator="," open="(" close=")" index="">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="query.countType == 3">
|
|
|
and subsidy_status = 0
|
|
|
</if>
|
|
|
- <if test="countType == 1">
|
|
|
+ <if test="query.countType == 1">
|
|
|
and subsidy_status = 1
|
|
|
</if>
|
|
|
<include refid="boWhere" />
|
|
|
@@ -113,32 +120,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and queue_order > #{currentQueueOrder}
|
|
|
</update>
|
|
|
|
|
|
- <select id="getSubsidyAmountByBusinessIds" resultType="java.math.BigDecimal">
|
|
|
- select
|
|
|
- <if test="countType == 1">
|
|
|
- IFNULL(sum(actual_subsidy_amount),0)
|
|
|
- </if>
|
|
|
- <if test="countType == 2">
|
|
|
- IFNULL(sum(subsidy_points),0)
|
|
|
- </if>
|
|
|
- <if test="countType == 3">
|
|
|
- IFNULL(sum(should_subsidy_amount-actual_subsidy_amount),0)
|
|
|
- </if>
|
|
|
- from tb_subsidy_queue
|
|
|
- <where>
|
|
|
- <if test="businessIds != null">
|
|
|
- and current_business_id in
|
|
|
- <foreach item="item" collection="businessIds" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="countType == 3">
|
|
|
- and subsidy_status = 0
|
|
|
- </if>
|
|
|
- <if test="countType == 1">
|
|
|
- and subsidy_status = 1
|
|
|
- </if>
|
|
|
- <include refid="boWhere" />
|
|
|
- </where>
|
|
|
- </select>
|
|
|
</mapper>
|