<?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
|
</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>
|
<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>
|
<select id="order" resultType="org.springblade.modules.integral.entity.Integral">
|
SELECT *
|
FROM sys_integral
|
ORDER BY integral DESC
|
LIMIT 0,10
|
</select>
|
|
</mapper>
|