123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.ym.mec.biz.dal.dao.StudentWithdrawDao">
- <resultMap type="com.ym.mec.biz.dal.entity.StudentWithdraw" id="StudentWithdraw">
- <result column="id_" property="id"/>
- <result column="user_id_" property="userId"/>
- <result column="bank_card_no_" property="bankCardNo"/>
- <result column="trans_no_" property="transNo"/>
- <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
- <result column="amount_" property="amount"/>
- <result column="fee_user_" property="feeUser"/>
- <result column="fee_platform_" property="feePlatform"/>
- <result column="description_" property="description"/>
- <result column="comment_" property="comment"/>
- <result column="withdraw_no_" property="withdrawNo"/>
- <result column="create_time_" property="createTime"/>
- <result column="modify_time_" property="modifyTime"/>
- <result column="channel_" property="channel"/>
- <result column="platform_account_no_" property="platformAccountNo"/>
- <result column="balance_" property="balance"/>
- <result column="real_name_" property="realName"/>
- </resultMap>
-
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="StudentWithdraw">
- SELECT * FROM student_withdraw WHERE id_ = #{id}
- </select>
- <!-- 全查询 -->
- <select id="findAll" resultMap="StudentWithdraw">
- SELECT * FROM student_withdraw ORDER BY id_
- </select>
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentWithdraw" useGeneratedKeys="true" keyColumn="id"
- keyProperty="id">
- INSERT INTO student_withdraw
- (id_,user_id_,bank_card_no_,trans_no_,status_,amount_,fee_user_,fee_platform_,description_,comment_,create_time_,modify_time_,withdraw_no_)
- VALUES(#{id},#{userId},#{bankCardNo},#{transNo},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- #{amount},#{feeUser},#{feePlatform},#{description},#{comment},now(),now(),#{withdrawNo})
- </insert>
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentWithdraw">
- UPDATE student_withdraw
- <set>
- <if test="status != null">
- status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- </if>
- <if test="userId != null">
- user_id_ = #{userId},
- </if>
- <if test="modifyTime != null">
- modify_time_ = #{modifyTime},
- </if>
- <if test="feePlatform != null">
- fee_platform_ = #{feePlatform},
- </if>
- <if test="comment != null">
- comment_ = #{comment},
- </if>
- <if test="amount != null">
- amount_ = #{amount},
- </if>
- <if test="feeUser != null">
- fee_user_ = #{feeUser},
- </if>
- <if test="bankCardNo != null">
- bank_card_no_ = #{bankCardNo},
- </if>
- <if test="description != null">
- description_ = #{description},
- </if>
- <if test="transNo != null">
- trans_no_ = #{transNo},
- </if>
- <if test="withdrawNo != null">
- withdraw_no_ = #{withdrawNo},
- </if>
- </set>
- WHERE id_ = #{id}
- </update>
- <!-- 根据主键删除一条记录 -->
- <delete id="delete">
- DELETE FROM student_withdraw WHERE id_ = #{id}
- </delete>
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="StudentWithdraw" parameterType="map">
- SELECT sw.*,cad.platform_account_no_,cad.channel_,su.real_name_,cad.balance_
- FROM student_withdraw sw
- LEFT JOIN sys_user_cash_account_detail cad ON sw.id_ = cad.attribute1_
- LEFT JOIN sys_user su ON sw.id_ = cad.attribute1_
- <where>
- <if test="userId != null">
- and sw.user_id_ = #{userId}
- </if>
- <if test="bankCardNo != null">
- and sw.bank_card_no_ = #{bankCardNo}
- </if>
- </where>
- ORDER BY sw.create_time_ DESC
- <include refid="global.limit"/>
- </select>
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(*) FROM student_withdraw
- <where>
- <if test="userId != null">
- and user_id_ = #{userId}
- </if>
- <if test="bankCardNo != null">
- and bank_card_no_ = #{bankCardNo}
- </if>
- </where>
- </select>
- <select id="getByUserId" resultMap="StudentWithdraw" parameterType="Long">
- SELECT * FROM student_withdraw
- <where>
- <if test="userId != null">
- user_id_ = #{userId}
- </if>
- </where>
- LIMIT 1
- </select>
- <select id="queryByUserId" resultType="com.ym.mec.biz.dal.entity.StudentWithdraw">
- SELECT * FROM student_withdraw
- <where>
- <if test="userId != null">
- FIND_IN_SET(user_id_,#{userIds})
- </if>
- </where>
- GROUP BY user_id_
- </select>
- </mapper>
|