| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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.UserBillingMapper">
-
- <resultMap type="UserBilling" id="UserBillingResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="type" column="type" />
- <result property="ddId" column="dd_id" />
- <result property="amount" column="amount" />
- <result property="state" column="state" />
- <result property="illustrate" column="illustrate" />
- <result property="paymentMethod" column="payment_method" />
- <result property="accountNumber" column="account_number" />
- <result property="mdId" column="md_id" />
- <result property="divvy" column="divvy" />
- <result property="balancePay" column="balance_pay" />
- </resultMap>
- <sql id="selectUserBillingVo">
- select id, user_id, type, dd_id, md_id,amount, divvy,state, illustrate, payment_method, account_number,balance_pay from user_billing
- </sql>
- <select id="selectUserBillingList" parameterType="UserBilling" resultMap="UserBillingResult">
- <include refid="selectUserBillingVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="type != null and type != ''"> and type = #{type}</if>
- <if test="ddId != null and ddId != ''"> and dd_id = #{ddId}</if>
- <if test="state != null and state != ''"> and state = #{state}</if>
- <if test="mdId != null and mdId != ''"> and md_id = #{mdId}</if>
- <if test="paymentMethod != null and paymentMethod != ''"> and payment_method like concat('%', #{paymentMethod}, '%')</if>
- <if test="accountNumber != null and accountNumber != ''"> and account_number like concat('%', #{accountNumber}, '%')</if>
- <if test="balancePay != null and balancePay != ''"> and balance_pay = #{balancePay}</if>
- </where>
- </select>
-
- <select id="selectUserBillingById" parameterType="Long" resultMap="UserBillingResult">
- <include refid="selectUserBillingVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertUserBilling" parameterType="UserBilling" useGeneratedKeys="true" keyProperty="id">
- insert into user_billing
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="type != null">type,</if>
- <if test="ddId != null">dd_id,</if>
- <if test="amount != null">amount,</if>
- <if test="state != null">state,</if>
- <if test="illustrate != null">illustrate,</if>
- <if test="paymentMethod != null">payment_method,</if>
- <if test="accountNumber != null">account_number,</if>
- <if test="mdId != null">md_id,</if>
- <if test="divvy != null">divvy,</if>
- <if test="balancePay != null">balance_pay,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="type != null">#{type},</if>
- <if test="ddId != null">#{ddId},</if>
- <if test="amount != null">#{amount},</if>
- <if test="state != null">#{state},</if>
- <if test="illustrate != null">#{illustrate},</if>
- <if test="paymentMethod != null">#{paymentMethod},</if>
- <if test="accountNumber != null">#{accountNumber},</if>
- <if test="mdId != null">#{mdId},</if>
- <if test="divvy != null">#{divvy},</if>
- <if test="balancePay != null">#{balancePay},</if>
- </trim>
- </insert>
- <update id="updateUserBilling" parameterType="UserBilling">
- update user_billing
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="ddId != null">dd_id = #{ddId},</if>
- <if test="amount != null">amount = #{amount},</if>
- <if test="state != null">state = #{state},</if>
- <if test="illustrate != null">illustrate = #{illustrate},</if>
- <if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
- <if test="accountNumber != null">account_number = #{accountNumber},</if>
- <if test="mdId != null">md_id = #{mdId},</if>
- <if test="divvy != null">divvy = #{divvy},</if>
- <if test="balancePay != null">balance_pay = #{balancePay},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteUserBillingById" parameterType="Long">
- delete from user_billing where id = #{id}
- </delete>
- <delete id="deleteUserBillingByIds" parameterType="String">
- delete from user_billing where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|