|
|
- <?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.model.mapper.AppWalletMapper">
-
- <resultMap type="AppWallet" id="AppWalletResult">
- <result property="id" column="id" />
- <result property="price" column="price" />
- <result property="remark" column="remark" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateTime" column="update_time" />
- <result property="updateBy" column="update_by" />
- <result property="delFlag" column="del_flag" />
- </resultMap>
-
- <sql id="selectAppWalletVo">
- select id, price, remark, create_time, create_by, update_time, update_by, del_flag from app_wallet
- </sql>
-
- <select id="selectAppWalletList" parameterType="AppWallet" resultMap="AppWalletResult">
- <include refid="selectAppWalletVo"/>
- <where>
- <if test="price != null "> and price = #{price}</if>
- </where>
- </select>
-
- <select id="selectAppWalletById" parameterType="Long" resultMap="AppWalletResult">
- <include refid="selectAppWalletVo"/>
- where id = #{id}
- </select>
- <select id="getAppWalletByUserId" resultType="com.ruoyi.model.domain.AppWallet">
- select wallet.* from app_wallet wallet join app_users users where users.user_id = #{usersId} and wallet.del_flag = 0 and users.del_flag = 0;
- </select>
-
- <insert id="insertAppWallet" parameterType="AppWallet">
- insert into app_wallet
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="price != null">price,</if>
- <if test="remark != null">remark,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="delFlag != null">del_flag,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="price != null">#{price},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="delFlag != null">#{delFlag},</if>
- </trim>
- </insert>
-
- <update id="updateAppWallet" parameterType="AppWallet">
- update app_wallet
- <trim prefix="SET" suffixOverrides=",">
- <if test="price != null">price = #{price},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- </trim>
- where id = #{id}
- </update>
-
- <delete id="deleteAppWalletById" parameterType="Long">
- delete from app_wallet where id = #{id}
- </delete>
-
- <delete id="deleteAppWalletByIds" parameterType="String">
- delete from app_wallet where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|