From 95f9ea7eb339c36cade6c67d0385c49ec2d81477 Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Wed, 14 Apr 2021 19:39:45 +0800 Subject: [PATCH] Merge branch 'score_shop' into api_score_meger --- zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml new file mode 100644 index 0000000..bc19396 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.score.dao.ScoreVipDetailDao"> + + <select id="selectUserTotalScore" resultType="java.lang.Integer"> + select IFNULL(sum(IFNULL(remain_score, 0 )),0) from score_vip_detail + where state=1 and vip_id=#{vipId} + + + </select> + + <select id="selectEffectiveScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> + select * + from score_vip_detail + where state = 1 and vip_id = #{vipId} + order by create_time + + </select> + + + <select id="selectInvalidaVipScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> + select * from score_vip_detail where state=1 and remain_score>0 and validite_time <![CDATA[ < now()]]> + </select> + + <update id="invalidVipScore"> + update score_vip_detail set state = 2 , remain_score=0 where state=1 and validite_time <![CDATA[ < now()]]> + </update> + +</mapper> \ No newline at end of file -- Gitblit v1.9.1