<?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.stylefeng.guns.modular.system.dao.WithdrawalMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Withdrawal">
|
<id column="id" property="id" />
|
<result column="userId" property="userId" />
|
<result column="insertTime`" property="insertTime`" />
|
<result column="amount" property="amount" />
|
<result column="applyAmount" property="applyAmount" />
|
<result column="state" property="state" />
|
<result column="payment" property="payment" />
|
<result column="reason" property="reason" />
|
</resultMap>
|
|
|
<select id="list" resultType="com.stylefeng.guns.modular.system.model.MoneyVO">
|
select t1.*,t2.name as userName,t2.phone as phone
|
from t_withdrawal t1
|
left join t_user t2 on t1.userId= t2.id
|
<where>
|
<if test="null != state">
|
and t1.state = #{state}
|
</if>
|
<if test="null != payment">
|
and t1.payment = #{payment}
|
</if>
|
<if test="null != userName and '' != userName">
|
and t2.name like CONCAT('%', #{userName}, '%')
|
</if>
|
<if test="null != phone and '' != phone">
|
and t2.phone like CONCAT('%', #{phone}, '%')
|
</if>
|
<if test="null != startTime ">
|
and t1.insertTime between #{startTime1} and #{endTime1}
|
</if>
|
</where>
|
order by t1.state,t1.insertTime desc
|
</select>
|
<select id="rechargeList" resultType="com.stylefeng.guns.modular.system.vo.RechargeListVO">
|
select t1.*,t2.name as userName,t2.phone as phone
|
from t_recharge t1
|
left join t_user t2 on t1.userId= t2.id
|
where t1.state = 2
|
<if test="null != userName and '' != userName">
|
and t2.name like CONCAT('%', #{userName}, '%')
|
</if>
|
<if test="null != phone and '' != phone">
|
and t2.phone like CONCAT('%', #{phone}, '%')
|
</if>
|
<if test="null != startTime ">
|
and t1.insertTime between #{startTime} and #{endTime}
|
</if>
|
order by t1.state asc,t1.insertTime desc
|
</select>
|
</mapper>
|