洪城义警-正式版后台
tangzy
2022-01-18 ebe1440caecb571988c6b97564b770960adf910e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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="org.springblade.modules.integral.mapper.IntegralMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="integralResultMap" type="org.springblade.modules.integral.entity.Integral">
        <id column="id" property="id"/>
        <result column="uid" property="uid"/>
        <result column="access" property="access"/>
        <result column="time" property="time"/>
        <result column="integral" property="integral"/>
    </resultMap>
 
 
    <select id="selectIntegralPage" resultMap="integralResultMap">
        select *
        from sys_integral
        where is_deleted = 0
    </select>
 
    <select id="selectCount" resultType="java.util.HashMap">
        SELECT COALESCE(sum(integral), 0) as integral
        FROM sys_integral
        WHERE type = 1 AND uid=#{uid}
        UNION ALL
        SELECT COALESCE(sum(integral), 0) AS integral
        FROM sys_integral
        WHERE type = 2 AND uid=#{uid}
    </select>
 
</mapper>