洪城义警-正式版后台
zengh
2022-05-26 4c19ddd36bdfb43b5ef4e8df3c9a98cd4d356d6c
src/main/java/org/springblade/modules/integral/mapper/IntegralMapper.xml
@@ -15,12 +15,28 @@
    <select id="selectIntegralPage" resultMap="integralResultMap">
        select *
        from sys_integral
        where is_deleted = 0
    </select>
    <select id="selectCount" resultType="java.lang.String">
    <select id="selectCount" resultType="java.util.HashMap">
        SELECT COALESCE(sum(integral), 0) as integral
        FROM sys_integral where  uid=#{uid}
        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>
    <select id="selectList" resultType="org.springblade.modules.integral.entity.Integral">
        SELECT *
        FROM sys_integral
        WHERE uid=#{uid}
        <if test="type == 2  ">
            and type =1
        </if>
        <if test="type == 3  ">
            and type =2
        </if>
    </select>
</mapper>