javacodeadmin/ruoyi-system/src/main/resources/mapper/system/UserBenefitPointsMapper.xml

111 lines
5.5 KiB
XML

<?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.UserBenefitPointsMapper">
<resultMap type="UserBenefitPoints" id="UserBenefitPointsResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="dotime" column="dotime" />
<result property="ordermoney" column="ordermoney" />
<result property="money" column="money" />
<result property="ordertype" column="ordertype" />
<result property="uid" column="uid" />
<result property="beformoney" column="beformoney" />
<result property="aftremoney" column="aftremoney" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="orderid" column="orderid" />
<result property="reamk" column="reamk" />
</resultMap>
<sql id="selectUserBenefitPointsVo">
select id, type, dotime, ordermoney, money, ordertype, uid, beformoney, aftremoney, created_at, updated_at, orderid, reamk from user_benefit_points
</sql>
<select id="selectUserBenefitPointsList" parameterType="UserBenefitPoints" resultMap="UserBenefitPointsResult">
<include refid="selectUserBenefitPointsVo"/>
<where>
<if test="type != null "> and type = #{type}</if>
<if test="dotime != null "> and dotime = #{dotime}</if>
<if test="ordermoney != null "> and ordermoney = #{ordermoney}</if>
<if test="money != null "> and money = #{money}</if>
<if test="ordertype != null "> and ordertype = #{ordertype}</if>
<if test="uid != null "> and uid = #{uid}</if>
<if test="beformoney != null "> and beformoney = #{beformoney}</if>
<if test="aftremoney != null "> and aftremoney = #{aftremoney}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="orderid != null "> and orderid = #{orderid}</if>
<if test="reamk != null and reamk != ''"> and reamk = #{reamk}</if>
</where>
</select>
<select id="selectUserBenefitPointsById" parameterType="Long" resultMap="UserBenefitPointsResult">
<include refid="selectUserBenefitPointsVo"/>
where id = #{id}
</select>
<insert id="insertUserBenefitPoints" parameterType="UserBenefitPoints" useGeneratedKeys="true" keyProperty="id">
insert into user_benefit_points
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="dotime != null">dotime,</if>
<if test="ordermoney != null">ordermoney,</if>
<if test="money != null">money,</if>
<if test="ordertype != null">ordertype,</if>
<if test="uid != null">uid,</if>
<if test="beformoney != null">beformoney,</if>
<if test="aftremoney != null">aftremoney,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="orderid != null">orderid,</if>
<if test="reamk != null">reamk,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="dotime != null">#{dotime},</if>
<if test="ordermoney != null">#{ordermoney},</if>
<if test="money != null">#{money},</if>
<if test="ordertype != null">#{ordertype},</if>
<if test="uid != null">#{uid},</if>
<if test="beformoney != null">#{beformoney},</if>
<if test="aftremoney != null">#{aftremoney},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="orderid != null">#{orderid},</if>
<if test="reamk != null">#{reamk},</if>
</trim>
</insert>
<update id="updateUserBenefitPoints" parameterType="UserBenefitPoints">
update user_benefit_points
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="dotime != null">dotime = #{dotime},</if>
<if test="ordermoney != null">ordermoney = #{ordermoney},</if>
<if test="money != null">money = #{money},</if>
<if test="ordertype != null">ordertype = #{ordertype},</if>
<if test="uid != null">uid = #{uid},</if>
<if test="beformoney != null">beformoney = #{beformoney},</if>
<if test="aftremoney != null">aftremoney = #{aftremoney},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="orderid != null">orderid = #{orderid},</if>
<if test="reamk != null">reamk = #{reamk},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserBenefitPointsById" parameterType="Long">
delete from user_benefit_points where id = #{id}
</delete>
<delete id="deleteUserBenefitPointsByIds" parameterType="String">
delete from user_benefit_points where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>