| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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.system.mapper.WalletTransactionMapper">
- <resultMap type="WalletTransaction" id="PointsTransactionResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="ddId" column="dd_id" />
- <result property="type" column="type" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- <result property="change" column="change" />
- <result property="currentBalance" column="current_balance" />
- </resultMap>
- <sql id="selectPointsTransactionVo">
- select id, user_id, dd_id, type, create_time, update_time, remark, change, current_balance from wallet_transaction
- </sql>
- <select id="selectPointsTransactionList" parameterType="WalletTransaction" resultMap="PointsTransactionResult">
- <include refid="selectPointsTransactionVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="ddId != null "> and dd_id = #{ddId}</if>
- <if test="type != null and type != ''"> and type = #{type}</if>
- <if test="change != null and change != ''"> and change = #{change}</if>
- <if test="currentBalance != null and currentBalance != ''"> and current_balance = #{currentBalance}</if>
- </where>
- </select>
- <select id="selectPointsTransactionById" parameterType="Long" resultMap="PointsTransactionResult">
- <include refid="selectPointsTransactionVo"/>
- where id = #{id}
- </select>
- <insert id="insertPointsTransaction" parameterType="WalletTransaction" useGeneratedKeys="true" keyProperty="id">
- insert into wallet_transaction
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="ddId != null">dd_id,</if>
- <if test="type != null and type != ''">type,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="change != null and change != ''">change,</if>
- <if test="currentBalance != null and currentBalance != ''">current_balance,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="ddId != null">#{ddId},</if>
- <if test="type != null and type != ''">#{type},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="change != null and change != ''">#{change},</if>
- <if test="currentBalance != null and currentBalance != ''">#{currentBalance},</if>
- </trim>
- </insert>
- <update id="updatePointsTransaction" parameterType="WalletTransaction">
- update wallet_transaction
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="ddId != null">dd_id = #{ddId},</if>
- <if test="type != null and type != ''">type = #{type},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="change != null and change != ''">change = #{change},</if>
- <if test="currentBalance != null and currentBalance != ''">current_balance = #{currentBalance},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deletePointsTransactionById" parameterType="Long">
- delete from wallet_transaction where id = #{id}
- </delete>
- <delete id="deletePointsTransactionByIds" parameterType="String">
- delete from wallet_transaction where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|