|
|
@@ -0,0 +1,154 @@
|
|
|
+<?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.fs.app.mapper.FsAppRoleMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsAppRole" id="FsAppRoleResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="roleName" column="role_name" />
|
|
|
+ <result property="registerRewardType" column="register_reward_type" />
|
|
|
+ <result property="registerRedPacket" column="register_red_packet" />
|
|
|
+ <result property="registerProductId" column="register_product_id" />
|
|
|
+ <result property="registerProductType" column="register_product_type" />
|
|
|
+ <result property="registerIntegral" column="register_integral" />
|
|
|
+ <result property="courseDay" column="course_day" />
|
|
|
+ <result property="courseRewardType" column="course_reward_type" />
|
|
|
+ <result property="courseRedPacket" column="course_red_packet" />
|
|
|
+ <result property="courseIntegral" column="course_integral" />
|
|
|
+ <result property="courseProductType" column="course_product_type" />
|
|
|
+ <result property="courseProductId" column="course_product_id" />
|
|
|
+ <result property="courseNeedDay" column="course_need_day" />
|
|
|
+ <result property="courseRewardRuleType" column="course_reward_rule_type" />
|
|
|
+ <result property="courseRewardRule" column="course_reward_rule" />
|
|
|
+ <result property="roleLevel" column="role_level" />
|
|
|
+ <result property="roleTags" column="role_tags" />
|
|
|
+ <result property="rolePackageProductIds" column="role_package_product_ids" />
|
|
|
+ <result property="roleStoreProductIds" column="role_store_product_ids" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsAppRoleVo">
|
|
|
+ select id, role_name, register_reward_type, register_red_packet, register_product_id, register_product_type, register_integral, course_day, course_reward_type, course_red_packet, course_integral, course_product_type, course_product_id, course_need_day, course_reward_rule_type, course_reward_rule, role_level, role_tags, role_package_product_ids, role_store_product_ids, create_time, update_time from fs_app_role
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsAppRoleList" parameterType="FsAppRole" resultMap="FsAppRoleResult">
|
|
|
+ <include refid="selectFsAppRoleVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="roleName != null and roleName != ''"> and role_name like concat('%', #{roleName}, '%')</if>
|
|
|
+ <if test="registerRewardType != null and registerRewardType != ''"> and register_reward_type = #{registerRewardType}</if>
|
|
|
+ <if test="registerRedPacket != null "> and register_red_packet = #{registerRedPacket}</if>
|
|
|
+ <if test="registerProductId != null "> and register_product_id = #{registerProductId}</if>
|
|
|
+ <if test="registerProductType != null "> and register_product_type = #{registerProductType}</if>
|
|
|
+ <if test="registerIntegral != null "> and register_integral = #{registerIntegral}</if>
|
|
|
+ <if test="courseDay != null "> and course_day = #{courseDay}</if>
|
|
|
+ <if test="courseRewardType != null "> and course_reward_type = #{courseRewardType}</if>
|
|
|
+ <if test="courseRedPacket != null "> and course_red_packet = #{courseRedPacket}</if>
|
|
|
+ <if test="courseIntegral != null "> and course_integral = #{courseIntegral}</if>
|
|
|
+ <if test="courseProductType != null "> and course_product_type = #{courseProductType}</if>
|
|
|
+ <if test="courseProductId != null "> and course_product_id = #{courseProductId}</if>
|
|
|
+ <if test="courseNeedDay != null "> and course_need_day = #{courseNeedDay}</if>
|
|
|
+ <if test="courseRewardRuleType != null "> and course_reward_rule_type = #{courseRewardRuleType}</if>
|
|
|
+ <if test="courseRewardRule != null and courseRewardRule != ''"> and course_reward_rule = #{courseRewardRule}</if>
|
|
|
+ <if test="roleLevel != null "> and role_level = #{roleLevel}</if>
|
|
|
+ <if test="roleTags != null and roleTags != ''"> and role_tags = #{roleTags}</if>
|
|
|
+ <if test="rolePackageProductIds != null and rolePackageProductIds != ''"> and role_package_product_ids = #{rolePackageProductIds}</if>
|
|
|
+ <if test="roleStoreProductIds != null and roleStoreProductIds != ''"> and role_store_product_ids = #{roleStoreProductIds}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsAppRoleById" parameterType="Long" resultMap="FsAppRoleResult">
|
|
|
+ <include refid="selectFsAppRoleVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsAppRole" parameterType="FsAppRole" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fs_app_role
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="roleName != null">role_name,</if>
|
|
|
+ <if test="registerRewardType != null">register_reward_type,</if>
|
|
|
+ <if test="registerRedPacket != null">register_red_packet,</if>
|
|
|
+ <if test="registerProductId != null">register_product_id,</if>
|
|
|
+ <if test="registerProductType != null">register_product_type,</if>
|
|
|
+ <if test="registerIntegral != null">register_integral,</if>
|
|
|
+ <if test="courseDay != null">course_day,</if>
|
|
|
+ <if test="courseRewardType != null">course_reward_type,</if>
|
|
|
+ <if test="courseRedPacket != null">course_red_packet,</if>
|
|
|
+ <if test="courseIntegral != null">course_integral,</if>
|
|
|
+ <if test="courseProductType != null">course_product_type,</if>
|
|
|
+ <if test="courseProductId != null">course_product_id,</if>
|
|
|
+ <if test="courseNeedDay != null">course_need_day,</if>
|
|
|
+ <if test="courseRewardRuleType != null">course_reward_rule_type,</if>
|
|
|
+ <if test="courseRewardRule != null">course_reward_rule,</if>
|
|
|
+ <if test="roleLevel != null">role_level,</if>
|
|
|
+ <if test="roleTags != null">role_tags,</if>
|
|
|
+ <if test="rolePackageProductIds != null">role_package_product_ids,</if>
|
|
|
+ <if test="roleStoreProductIds != null">role_store_product_ids,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="roleName != null">#{roleName},</if>
|
|
|
+ <if test="registerRewardType != null">#{registerRewardType},</if>
|
|
|
+ <if test="registerRedPacket != null">#{registerRedPacket},</if>
|
|
|
+ <if test="registerProductId != null">#{registerProductId},</if>
|
|
|
+ <if test="registerProductType != null">#{registerProductType},</if>
|
|
|
+ <if test="registerIntegral != null">#{registerIntegral},</if>
|
|
|
+ <if test="courseDay != null">#{courseDay},</if>
|
|
|
+ <if test="courseRewardType != null">#{courseRewardType},</if>
|
|
|
+ <if test="courseRedPacket != null">#{courseRedPacket},</if>
|
|
|
+ <if test="courseIntegral != null">#{courseIntegral},</if>
|
|
|
+ <if test="courseProductType != null">#{courseProductType},</if>
|
|
|
+ <if test="courseProductId != null">#{courseProductId},</if>
|
|
|
+ <if test="courseNeedDay != null">#{courseNeedDay},</if>
|
|
|
+ <if test="courseRewardRuleType != null">#{courseRewardRuleType},</if>
|
|
|
+ <if test="courseRewardRule != null">#{courseRewardRule},</if>
|
|
|
+ <if test="roleLevel != null">#{roleLevel},</if>
|
|
|
+ <if test="roleTags != null">#{roleTags},</if>
|
|
|
+ <if test="rolePackageProductIds != null">#{rolePackageProductIds},</if>
|
|
|
+ <if test="roleStoreProductIds != null">#{roleStoreProductIds},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsAppRole" parameterType="FsAppRole">
|
|
|
+ update fs_app_role
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="roleName != null">role_name = #{roleName},</if>
|
|
|
+ <if test="registerRewardType != null">register_reward_type = #{registerRewardType},</if>
|
|
|
+ <if test="registerRedPacket != null">register_red_packet = #{registerRedPacket},</if>
|
|
|
+ <if test="registerProductId != null">register_product_id = #{registerProductId},</if>
|
|
|
+ <if test="registerProductType != null">register_product_type = #{registerProductType},</if>
|
|
|
+ <if test="registerIntegral != null">register_integral = #{registerIntegral},</if>
|
|
|
+ <if test="courseDay != null">course_day = #{courseDay},</if>
|
|
|
+ <if test="courseRewardType != null">course_reward_type = #{courseRewardType},</if>
|
|
|
+ <if test="courseRedPacket != null">course_red_packet = #{courseRedPacket},</if>
|
|
|
+ <if test="courseIntegral != null">course_integral = #{courseIntegral},</if>
|
|
|
+ <if test="courseProductType != null">course_product_type = #{courseProductType},</if>
|
|
|
+ <if test="courseProductId != null">course_product_id = #{courseProductId},</if>
|
|
|
+ <if test="courseNeedDay != null">course_need_day = #{courseNeedDay},</if>
|
|
|
+ <if test="courseRewardRuleType != null">course_reward_rule_type = #{courseRewardRuleType},</if>
|
|
|
+ <if test="courseRewardRule != null">course_reward_rule = #{courseRewardRule},</if>
|
|
|
+ <if test="roleLevel != null">role_level = #{roleLevel},</if>
|
|
|
+ <if test="roleTags != null">role_tags = #{roleTags},</if>
|
|
|
+ <if test="rolePackageProductIds != null">role_package_product_ids = #{rolePackageProductIds},</if>
|
|
|
+ <if test="roleStoreProductIds != null">role_store_product_ids = #{roleStoreProductIds},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsAppRoleById" parameterType="Long">
|
|
|
+ delete from fs_app_role where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsAppRoleByIds" parameterType="String">
|
|
|
+ delete from fs_app_role where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|