hjl
2024-07-01 03c6572c7918beaa20365e69c9694a11f0d9948a
ruoyi-service/ruoyi-admin/src/main/resources/mapper/admin/WithdrawMapper.xml
@@ -9,7 +9,7 @@
        <result column="apply_for_time" property="applyForTime"/>
        <result column="apply_for_money" property="applyForMoney"/>
        <result column="state" property="state"/>
        <result column="opinions" property="opinions"/>
        <result column="opinion" property="opinion"/>
        <result column="createBy" property="createBy"/>
        <result column="updateBy" property="updateBy"/>
        <result column="createTime" property="createTime"/>
@@ -22,9 +22,9 @@
        FROM t_withdraw w
                 LEFT JOIN t_user u on w.user_id = u.id
        <where>
            <if test="ids != null and ids.size() != 0">
                u.city_id in
                <foreach collection="ids" item="id" open="(" separator="," close=")">
            <if test="cityList != null and cityList.size() != 0">
                u.city in
                <foreach collection="cityList" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
@@ -38,9 +38,9 @@
        <where>
            YEAR(w.createTime) = YEAR(NOW())
              and w.is_delete = 0
            <if test="ids != null and ids.size() != 0">
                and u.city_id in
                <foreach collection="ids" item="id" open="(" separator="," close=")">
            <if test="cityList != null and cityList.size() != 0">
                and u.city in
                <foreach collection="cityList" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
@@ -55,9 +55,9 @@
            YEAR(w.createTime) = YEAR(NOW())
              AND YEAR(w.createTime) = YEAR(NOW())
              and w.is_delete = 0
            <if test="ids != null and ids.size() != 0">
                and u.city_id in
                <foreach collection="ids" item="id" open="(" separator="," close=")">
            <if test="cityList != null and cityList.size() != 0">
                and u.city in
                <foreach collection="cityList" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
@@ -72,16 +72,12 @@
        <result column="apply_for_money" property="applyForMoney"/>
        <result column="state" property="state"/>
        <result column="opinions" property="opinions"/>
        <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="user_no" property="userNo"/>
        <result column="profile_picture" property="profilePicture"/>
        <result column="nickname" property="nickname"/>
        <result column="phone" property="userPhone"/>
    </resultMap>
    <select id="withdrawList" resultType="com.ruoyi.admin.vo.UserWithdrawRecordVO">
    <select id="withdrawList" resultMap="voMap">
        SELECT w.*, u.user_no, u.profile_picture, u.nickname
        FROM t_withdraw w
                 LEFT JOIN t_user u on w.user_id = u.id
@@ -93,4 +89,65 @@
            </if>
        </where>
    </select>
    <select id="withdrawPage" resultMap="voMap">
        SELECT w.*, u.user_no, u.profile_picture, u.nickname
        FROM t_withdraw w
                 LEFT JOIN t_user u on w.user_id = u.id
        <where>
            w.is_delete = 0
              and u.is_delete = 0
            <if test="name != null and name != ''">
                and u.nickname like concat('%', #{name}, '%')
            </if>
            <if test="phone != null and phone != ''">
                and u.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="exportList" resultMap="voMap">
        SELECT w.*, u.user_no, u.profile_picture, u.nickname, u.phone
        FROM t_withdraw w
                 LEFT JOIN t_user u on w.user_id = u.id
        <where>
            w.is_delete = 0
              and u.is_delete = 0
            <if test="name != null and name != ''">
                and u.nickname like concat('%', #{name}, '%')
            </if>
            <if test="phone != null and phone != ''">
                and u.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 w.*, u.user_no, u.profile_picture, u.nickname
        FROM t_withdraw w
                 LEFT JOIN t_user u on w.user_id = u.id
        <where>
            w.is_delete = 0
              and u.is_delete = 0
              and w.id in
            <foreach collection="list" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </where>
        order by w.createTime desc
    </select>
</mapper>