<?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.ruoyi.order.mapper.WithdrawMapper">
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.order.entity.Withdraw">
|
<id column="id" property="id"/>
|
<result column="user_id" property="userId"/>
|
<result column="user_phone" property="userPhone"/>
|
<result column="apply_for_time" property="applyForTime"/>
|
<result column="apply_for_money" property="applyForMoney"/>
|
<result column="state" property="state"/>
|
<result column="opinion" property="opinion"/>
|
<result column="createBy" property="createBy"/>
|
<result column="updateBy" property="updateBy"/>
|
<result column="createTime" property="createTime"/>
|
<result column="updateTime" property="updateTime"/>
|
<result column="is_delete" property="isDelete"/>
|
<result column="order_id" property="orderId"/>
|
</resultMap>
|
|
<select id="withdrawPage" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
<if test="userIds != null and userIds.size() != 0">
|
and w.user_id in
|
<foreach collection="userIds" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
|
<if test="phone != null and phone != ''">
|
and w.user_phone like concat('%', #{phone}, '%')
|
</if>
|
<if test="time != null and time != ''">
|
and DATE(w.apply_for_time) = #{time}
|
</if>
|
<if test="state != null">
|
and w.state = #{state}
|
</if>
|
</where>
|
order by w.createTime desc
|
</select>
|
|
<select id="withdrawPage1" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
|
<if test="userIds != null and userIds.size() != 0">
|
and w.user_id in
|
<foreach collection="userIds" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="cityList != null and cityList.size() != 0">
|
and w.city_code in
|
<foreach collection="cityList" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
|
<if test="phone != null and phone != ''">
|
and w.user_phone like concat('%', #{phone}, '%')
|
</if>
|
<if test="time != null and time != ''">
|
and DATE(w.apply_for_time) = #{time}
|
</if>
|
<if test="state != null">
|
and w.state = #{state}
|
</if>
|
</where>
|
order by w.apply_for_time desc
|
</select>
|
|
<!--vo类映射-->
|
<resultMap id="voMap" type="com.ruoyi.order.vo.UserWithdrawRecordVO">
|
<id column="id" property="id"/>
|
<result column="user_id" property="userId"/>
|
<result column="apply_for_time" property="applyForTime"/>
|
<result column="apply_for_money" property="applyForMoney"/>
|
<result column="state" property="state"/>
|
<result column="opinion" property="opinions"/>
|
<result column="user_no" property="userNo"/>
|
<result column="profile_picture" property="profilePicture"/>
|
<result column="nick_name" property="nickname"/>
|
<result column="user_phone" property="userPhone"/>
|
</resultMap>
|
|
<select id="exportList" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
<if test="name != null and name != ''">
|
and w.nick_name like concat('%', #{name}, '%')
|
</if>
|
<if test="phone != null and phone != ''">
|
and w.user_phone like concat('%', #{phone}, '%')
|
</if>
|
<if test="time != null and time != ''">
|
and DATE(w.apply_for_time) = #{time}
|
</if>
|
<if test="state != null">
|
and w.state = #{state}
|
</if>
|
</where>
|
order by w.createTime desc
|
</select>
|
|
<select id="exportByIdList" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
and w.id in
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</where>
|
order by w.createTime desc
|
</select>
|
|
<select id="withdrawalTotalMoney" resultType="java.math.BigDecimal">
|
SELECT sum(w.apply_for_money)
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0 and w.state = 1
|
<if test="start != null and start != ''">
|
and w.createTime <![CDATA[ >= ]]> #{start}
|
</if>
|
<if test="end != null and end != ''">
|
and w.createTime <![CDATA[ <= ]]> #{end}
|
</if>
|
<if test="cityList != null and cityList.size() != 0">
|
and city_code in
|
<foreach collection="cityList" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="withdrawalTotalMoneyByYear" resultType="java.math.BigDecimal">
|
SELECT sum(w.apply_for_money)
|
FROM t_withdraw w
|
<where>
|
YEAR(w.createTime) = YEAR(NOW())
|
and w.is_delete = 0 and w.state = 1
|
<if test="cityList != null and cityList.size() != 0">
|
and w.city_code in
|
<foreach collection="cityList" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="withdrawalTotalMoneyByMonth" resultType="java.math.BigDecimal">
|
SELECT sum(w.apply_for_money)
|
FROM t_withdraw w
|
<where>
|
YEAR(w.createTime) = YEAR(NOW())
|
AND MONTH(w.createTime) = MONTH(NOW())
|
and w.is_delete = 0 and w.state = 1
|
<if test="cityList != null and cityList.size() != 0">
|
and w.city_code in
|
<foreach collection="cityList" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="withdrawList" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
<if test="userId != null and userId != ''">
|
and w.user_id = #{userId}
|
</if>
|
</where>
|
</select>
|
|
|
|
<select id="withdrawList1" resultMap="voMap">
|
SELECT *
|
FROM t_withdraw w
|
<where>
|
w.is_delete = 0
|
<if test="cityList != null and cityList.size() != 0">
|
and w.city_code in
|
<foreach collection="cityList" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="userId != null and userId != ''">
|
and w.user_id = #{userId}
|
</if>
|
</where>
|
order by w.apply_for_time desc
|
</select>
|
</mapper>
|