<?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.web.work.mapper.PayMapper">
    
    <select id="selectList" resultType="com.ruoyi.web.work.domain.Pay">
        select * from tb_pay
        <where>  
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="nums != null  and nums != ''"> and nums like concat('%', #{nums}, '%')</if>
            <if test="money != null "> and money = #{money}</if>
            <if test="state != null "> and state = #{state}</if>
            <if test="type != null "> and type = #{type}</if>
            <if test="dateBegin != null  and dateBegin != ''"> AND create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
        </where>
        order by id desc
    </select>

    <select id="selectByNums" resultType="com.ruoyi.web.work.domain.Pay">
        SELECT * FROM tb_pay WHERE nums=#{nums}
    </select>

</mapper>