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.
70 lines
3.0 KiB
70 lines
3.0 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.example.demo.mapper.pay.BeanRechargeMapper3">
|
|
<select id="selectByOnline" resultType="com.example.demo.domain.vo.bean.BeanOnlineRechargeInfo">
|
|
SELECT g.id AS id,
|
|
g.jwcode AS jwcode,
|
|
m.name AS name,
|
|
m.deptName AS market,
|
|
g.order_no AS orderNo,
|
|
g.count AS num,
|
|
g.price AS money,
|
|
g.platform AS platform,
|
|
FROM_UNIXTIME(g.add_time) AS rechargeTime
|
|
FROM g_order g
|
|
LEFT JOIN member_info m ON g.jwcode = m.jwcode
|
|
<where>
|
|
g.type = "gold" AND g.state = 1
|
|
<if test="jwcode != null and jwcode != ''">
|
|
AND g.jwcode = #{jwcode}
|
|
</if>
|
|
<if test="market != null and market != ''">
|
|
AND m.deptName = #{market}
|
|
</if>
|
|
<if test="orderNo != null and orderNo != ''">
|
|
AND g.order_no = #{orderNo}
|
|
</if>
|
|
<if test="platform != null and platform != ''">
|
|
AND g.platform = #{platform}
|
|
</if>
|
|
<if test="startTime != null and endTime != null">
|
|
AND FROM_UNIXTIME(g.add_time) BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
</where>
|
|
<trim prefix="ORDER BY" suffixOverrides=",">
|
|
<choose>
|
|
<!-- 当指定排序字段时使用指定字段排序 -->
|
|
<when test="sortField != null and sortField != ''">
|
|
<choose>
|
|
<!-- 对金币数量的排序处理 -->
|
|
<when test="sortField == 'num'">g.count</when>
|
|
<when test="sortField == 'money'">g.price</when>
|
|
<!-- 对时间字段的排序处理 -->
|
|
<when test="sortField == 'rechargeTime'">g.add_time</when>
|
|
<!-- 其他字段不支持排序,使用默认排序 -->
|
|
<otherwise>g.add_time</otherwise>
|
|
</choose>
|
|
<!-- 排序方向处理 -->
|
|
<if test="sortOrder != null and sortOrder != ''">
|
|
<choose>
|
|
<when test="sortOrder == 'ASC'">ASC</when>
|
|
<when test="sortOrder == 'DESC'">DESC</when>
|
|
<otherwise>DESC</otherwise>
|
|
</choose>
|
|
</if>
|
|
<if test="sortOrder == null or sortOrder == ''">
|
|
DESC
|
|
</if>
|
|
</when>
|
|
<!-- 未指定排序字段时,使用默认的时间降序排序 -->
|
|
<otherwise>
|
|
g.add_time DESC
|
|
</otherwise>
|
|
</choose>
|
|
</trim>
|
|
</select>
|
|
|
|
<select id="onlineMarket" resultType="java.lang.String">
|
|
select DISTINCT deptName from member_info
|
|
</select>
|
|
</mapper>
|