| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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.ylx.point.mapper.PointUserLogMapper">
-
- <resultMap type="PointUserLog" id="PointUserLogResult">
- <result property="id" column="id" />
- <result property="openId" column="open_id" />
- <result property="activityId" column="activity_id" />
- <result property="activityName" column="activity_name" />
- <result property="taskId" column="task_id" />
- <result property="taskName" column="task_name" />
- <result property="taskType" column="task_type" />
- <result property="points" column="points" />
- <result property="balanceAfter" column="balance_after" />
- <result property="sourceLogId" column="source_log_id" />
- <result property="bizOrderId" column="biz_order_id" />
- <result property="expireTime" column="expire_time" />
- <result property="isExpired" column="is_expired" />
- <result property="createTime" column="create_time" />
- <result property="opType" column="op_type" />
- <result property="month" column="month" />
- </resultMap>
- <select id="getUserPointLogList" resultType="com.ylx.point.domain.vo.UserPointLogVO">
- SELECT
- pul.activity_name AS activityName,
- pul.points AS points,
- pul.op_type AS opType,
- pul.create_time AS createTime
- FROM
- point_user_log pul
- <where>
- <if test="dto.openId != null and dto.openId != ''">
- and pul.open_id = #{dto.openId}
- </if>
- <if test="dto.opType != null and dto.opType != ''">
- AND pul.op_type = #{dto.opType}
- </if>
- </where>
- ORDER BY
- pul.create_time DESC
- </select>
- <!-- PC端根据用户openId查询用户积分详情 -->
- <select id="selectPcUserPointDetailList" resultType="com.ylx.point.domain.vo.UserPointDetailVO">
- SELECT
- COALESCE(NULLIF(pul.activity_name, ''), pul.task_name) AS pointProject,
- CASE
- WHEN pul.op_type = 1 THEN CONCAT('+', pul.points)
- WHEN pul.op_type IN (2, 3) THEN CONCAT('-', pul.points)
- ELSE CAST(pul.points AS CHAR)
- END AS pointChange,
- pul.create_time AS createTime
- FROM
- point_user_log pul
- <where>
- pul.open_id = #{dto.openId}
- <if test="dto.pointProject != null and dto.pointProject != '' and dto.pointProject != '全部'">
- AND COALESCE(NULLIF(pul.activity_name, ''), pul.task_name) = #{dto.pointProject}
- </if>
- <if test="dto.startTime != null and dto.startTime != ''">
- AND pul.create_time >= #{dto.startTime}
- </if>
- <if test="dto.endTime != null and dto.endTime != ''">
- AND pul.create_time <= #{dto.endTime}
- </if>
- </where>
- ORDER BY
- pul.create_time DESC
- </select>
- </mapper>
|