<?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.RechargeMapper">
    
    <select id="selectList" resultType="com.ruoyi.web.work.domain.Recharge">
        SELECT
        r.*,
        c.company_name
        FROM
        tb_recharge r
        LEFT JOIN tb_company c ON c.id = r.company_id
        <where>
            <if test="companyName != null  and companyName != ''"> and c.company_name like concat('%', #{companyName}, '%')</if>
            <if test="nums != null  and nums != ''"> and r.nums like concat('%', #{nums}, '%')</if>
            <if test="companyId != null "> and r.company_id = #{companyId}</if>
            <if test="state != null "> and r.state = #{state}</if>
            <if test="dateBegin != null  and dateBegin != ''"> AND r.create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
        </where>
    </select>

</mapper>