v1.0.33
This commit is contained in:
@@ -12,6 +12,26 @@
|
||||
AND `effective_at` >= #{beginAt} AND `effective_at` <= #{endAt} AND `deleted_at` IS NULL
|
||||
ORDER BY `effective_at` ASC, `id` ASC
|
||||
</select>
|
||||
<sql id="pageWhere">
|
||||
r.`deleted_at` IS NULL
|
||||
<if test="storeId != null and storeId != ''">AND r.`store_id` = #{storeId}</if>
|
||||
<if test="customerId != null and customerId != ''">AND r.`customer_id` = #{customerId}</if>
|
||||
<if test="sourceType != null">AND r.`source_type` = #{sourceType}</if>
|
||||
<if test="status != null">AND r.`status` = #{status}</if>
|
||||
<if test="beginAt != null">AND r.`effective_at` >= #{beginAt}</if>
|
||||
<if test="endAt != null">AND r.`effective_at` <= #{endAt}</if>
|
||||
</sql>
|
||||
<select id="countByQuery" resultType="long">
|
||||
SELECT COUNT(1) FROM `gao_customer_consumption_record` r WHERE <include refid="pageWhere"/>
|
||||
</select>
|
||||
<select id="sumAmountByPage" resultType="long">
|
||||
SELECT COALESCE(SUM(r.`amount`), 0) FROM `gao_customer_consumption_record` r WHERE <include refid="pageWhere"/>
|
||||
</select>
|
||||
<select id="selectByQuery" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerConsumptionRecord">
|
||||
SELECT r.* FROM `gao_customer_consumption_record` r WHERE <include refid="pageWhere"/>
|
||||
ORDER BY r.`effective_at` DESC, r.`created_at` DESC
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
<update id="revokeBySource">
|
||||
UPDATE `gao_customer_consumption_record`
|
||||
SET `status` = 'REVOKED', `revoked_at` = #{revokedAt}, `revoke_reason` = #{revokeReason}, `updated_at` = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000)
|
||||
|
||||
Reference in New Issue
Block a user