935090232@qq.com
2021-07-10 0374ff12e640761353a1f280e2691deaaa620a6c
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml
@@ -141,6 +141,9 @@
        </set>
        WHERE id=#{id}
    </update>
    <update id="updateId">
        update money_card_use set id=#{newId} where id=#{id}
    </update>
    <!-- 批量删除 -->
@@ -619,12 +622,12 @@
   </select>
    <select id="selectVipCardTotalMoney" resultType="java.lang.Double">
            SELECT TRUNCATE( SUM(gift_money)+SUM(real_money) ,2 ) from money_card_use where vip_id=#{vipId}  and `status` ='有效'
            SELECT  IFNULL(sum(IFNULL(gift_money, 0)),0)+ IFNULL(sum(IFNULL(real_money, 0)),0)  from money_card_use where vip_id=#{vipId}  and `status` ='有效'
    </select>
    <select id="selectHasValidMoneyCardUse" resultMap="MoneyCardUseSimpleMap">
        select * from money_card_use
    <update id="updateInvalidMoneyCardUse">
        update money_card_use set STATUS='无效'
        where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效'
    </select>
    </update>
</mapper>