update 会员组

This commit is contained in:
2023-12-26 14:59:02 +08:00
parent f48e7fe992
commit 2174a550f5
8 changed files with 918 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
<?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.jsowell.pile.mapper.MemberGroupMapper">
<resultMap type="com.jsowell.pile.domain.MemberGroup" id="MemberGroupResult">
<result property="id" column="id" />
<result property="groupCode" column="group_code" />
<result property="merchantId" column="merchant_id" />
<result property="stationId" column="station_id" />
<result property="groupLevel" column="group_level" />
<result property="groupType" column="group_type" />
<result property="discount" column="discount" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectMemberGroupVo">
select id, group_code, merchant_id, station_id, group_level, group_type, discount, create_by, create_time, update_by, update_time, del_flag from member_group
</sql>
<select id="selectMemberGroupList" parameterType="com.jsowell.pile.domain.MemberGroup" resultMap="MemberGroupResult">
<include refid="selectMemberGroupVo"/>
<where>
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
<if test="groupLevel != null and groupLevel != ''"> and group_level = #{groupLevel}</if>
<if test="groupType != null and groupType != ''"> and group_type = #{groupType}</if>
<if test="discount != null "> and discount = #{discount}</if>
</where>
</select>
<select id="selectMemberGroupById" parameterType="Long" resultMap="MemberGroupResult">
<include refid="selectMemberGroupVo"/>
where id = #{id}
</select>
<insert id="insertMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
insert into member_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="groupCode != null">group_code,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="stationId != null">station_id,</if>
<if test="groupLevel != null">group_level,</if>
<if test="groupType != null">group_type,</if>
<if test="discount != null">discount,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="groupCode != null">#{groupCode},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="stationId != null">#{stationId},</if>
<if test="groupLevel != null">#{groupLevel},</if>
<if test="groupType != null">#{groupType},</if>
<if test="discount != null">#{discount},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMemberGroup" parameterType="com.jsowell.pile.domain.MemberGroup">
update member_group
<trim prefix="SET" suffixOverrides=",">
<if test="groupCode != null">group_code = #{groupCode},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="groupLevel != null">group_level = #{groupLevel},</if>
<if test="groupType != null">group_type = #{groupType},</if>
<if test="discount != null">discount = #{discount},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberGroupById" parameterType="Long">
delete from member_group where id = #{id}
</delete>
<delete id="deleteMemberGroupByIds" parameterType="String">
delete from member_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>