forked from luyan/epmet-cloud-lingshan
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.6 KiB
66 lines
2.6 KiB
<?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.epmet.dao.UserPointActionLogDao">
|
|
|
|
<resultMap type="com.epmet.entity.UserPointActionLogEntity" id="userPointActionLogMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="userId" column="USER_ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="actionFlag" column="ACTION_FLAG"/>
|
|
<result property="eventId" column="EVENT_ID"/>
|
|
<result property="sourceId" column="SOURCE_ID" />
|
|
<result property="eventStatement" column="EVENT_STATEMENT"/>
|
|
<result property="eventName" column="EVENT_NAME"/>
|
|
<result property="point" column="POINT"/>
|
|
<result property="operatorAgencyId" column="OPERATOR_AGENCY_ID"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!-- 查询用户积分明细,按照时间倒叙 传参:用户Id -->
|
|
<select id="selectPointActionLogList" resultType="com.epmet.dto.result.ResiPointLogPeriodResultDTO">
|
|
SELECT
|
|
EVENT_NAME AS TITLE,
|
|
IFNULL(EVENT_STATEMENT,'') AS REMARK,
|
|
CASE ACTION_FLAG WHEN 'plus' THEN concat('+',POINT) ELSE POINT END AS point,
|
|
DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') AS DATE,
|
|
DATE_FORMAT(CREATED_TIME,'%H:%i') AS TIME
|
|
FROM
|
|
USER_POINT_ACTION_LOG
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND
|
|
USER_ID = #{userId}
|
|
AND
|
|
CUSTOMER_ID = #{customerId}
|
|
ORDER BY
|
|
CREATED_TIME DESC
|
|
</select>
|
|
|
|
<!-- 查询指定用户在某条规则下所得的积分总和 -->
|
|
<select id="selectSumByEvent" resultType="integer">
|
|
SELECT
|
|
SUM( POINT )
|
|
FROM
|
|
USER_POINT_ACTION_LOG
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND USER_ID = #{userId}
|
|
AND EVENT_ID = #{eventId}
|
|
<if test='null != customerId and "" != customerId'>
|
|
AND CUSTOMER_ID = #{customerId}
|
|
</if>
|
|
<if test='null != sourceId and "" != sourceId'>
|
|
AND SOURCE_ID = #{sourceId}
|
|
</if>
|
|
<if test="null != dateCheck">
|
|
AND CREATED_TIME <![CDATA[ >= ]]> #{dateCheck}
|
|
</if>
|
|
|
|
</select>
|
|
</mapper>
|