123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.fastGpt.mapper.FastGptRoleMapper">
- <resultMap type="FastGptRole" id="FastGptRoleResult">
- <result property="roleId" column="role_id" />
- <result property="roleName" column="role_name" />
- <result property="companyId" column="company_id" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="roleType" column="role_type" />
- <result property="modeConfigJson" column="mode_config_json" />
- <result property="mode" column="mode" />
- <result property="kfId" column="kf_id" />
- <result property="kfUrl" column="kf_url" />
- <result property="avatar" column="avatar" />
- <result property="kfMediaId" column="kf_media_id" />
- <result property="reminderWords" column="reminder_words" />
- <result property="bindCorpId" column="bind_corp_id" />
- <result property="contactInfo" column="contact_info" />
- <result property="channelType" column="channel_type" />
- </resultMap>
- <sql id="selectFastGptRoleVo">
- select role_id, role_name,contact_info,company_id, create_time, update_time, role_type, mode_config_json, mode, kf_id, kf_url, avatar, kf_media_id,reminder_words, bind_corp_id,channel_type from fastgpt_role
- </sql>
- <select id="selectFastGptRoleList" parameterType="FastGptRole" resultMap="FastGptRoleResult">
- <include refid="selectFastGptRoleVo"/>
- <where>
- <if test="roleName != null and roleName != ''"> and role_name like concat('%', #{roleName}, '%')</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="roleType != null "> and role_type = #{roleType}</if>
- <if test="modeConfigJson != null and modeConfigJson != ''"> and mode_config_json = #{modeConfigJson}</if>
- <if test="mode != null "> and mode = #{mode}</if>
- <if test="kfId != null and kfId != ''"> and kf_id = #{kfId}</if>
- <if test="kfUrl != null and kfUrl != ''"> and kf_url = #{kfUrl}</if>
- <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
- <if test="kfMediaId != null and kfMediaId != ''"> and kf_media_id = #{kfMediaId}</if>
- <if test="reminderWords != null and reminderWords != ''"> and reminder_words = #{reminderWords}</if>
- <if test="bindCorpId != null and bindCorpId != ''"> and bind_corp_id = #{bindCorpId}</if>
- </where>
- </select>
- <select id="selectFastGptRoleByRoleId" parameterType="Long" resultMap="FastGptRoleResult">
- <include refid="selectFastGptRoleVo"/>
- where role_id = #{roleId}
- </select>
- <select id="selectFastGptRoleByRoleIds" resultType="com.fs.fastGpt.domain.FastGptRole">
- select role_id roleId,role_name roleName from fastgpt_role
- <where>
- <if test="roleIds != null">
- role_id in
- <foreach collection="roleIds" item="roleId" separator="," open="(" close=")">
- #{roleId}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectFastGptRoleRoleIdsByAppKey" resultType="java.lang.String">
- select
- role_id as roleId
- from fastgpt_role
- where mode_config_json like concat('{"APPKey":"', #{appKey}, '%')
- </select>
- <select id="selectFastGptRoleAppKeyList" resultType="com.fs.fastGpt.vo.FastgptEventLogTotalVo">
- select
- role_id as roleId,role_name as roleName,mode_config_json as appKey
- from fastgpt_role
- </select>
- <insert id="insertFastGptRole" parameterType="FastGptRole" useGeneratedKeys="true" keyProperty="roleId">
- insert into fastgpt_role
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="roleName != null">role_name,</if>
- <if test="companyId != null">company_id,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="roleType != null">role_type,</if>
- <if test="modeConfigJson != null">mode_config_json,</if>
- <if test="mode != null">mode,</if>
- <if test="kfId != null">kf_id,</if>
- <if test="kfUrl != null">kf_url,</if>
- <if test="avatar != null">avatar,</if>
- <if test="kfMediaId != null">kf_media_id,</if>
- <if test="reminderWords != null">reminder_words,</if>
- <if test="bindCorpId != null">bind_corp_id,</if>
- <if test="contactInfo != null">contact_info,</if>
- <if test="channelType != null">channel_type,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="roleName != null">#{roleName},</if>
- <if test="companyId != null">#{companyId},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="roleType != null">#{roleType},</if>
- <if test="modeConfigJson != null">#{modeConfigJson},</if>
- <if test="mode != null">#{mode},</if>
- <if test="kfId != null">#{kfId},</if>
- <if test="kfUrl != null">#{kfUrl},</if>
- <if test="avatar != null">#{avatar},</if>
- <if test="kfMediaId != null">#{kfMediaId},</if>
- <if test="reminderWords != null">#{reminderWords},</if>
- <if test="bindCorpId != null">#{bindCorpId},</if>
- <if test="contactInfo != null">#{contactInfo},</if>
- <if test="channelType != null">#{channelType},</if>
- </trim>
- </insert>
- <update id="updateFastGptRole" parameterType="FastGptRole">
- update fastgpt_role
- <trim prefix="SET" suffixOverrides=",">
- <if test="roleName != null">role_name = #{roleName},</if>
- <if test="companyId != null">company_id = #{companyId},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="roleType != null">role_type = #{roleType},</if>
- <if test="modeConfigJson != null">mode_config_json = #{modeConfigJson},</if>
- <if test="mode != null">mode = #{mode},</if>
- <if test="kfId != null">kf_id = #{kfId},</if>
- <if test="kfUrl != null">kf_url = #{kfUrl},</if>
- <if test="avatar != null">avatar = #{avatar},</if>
- <if test="kfMediaId != null">kf_media_id = #{kfMediaId},</if>
- <if test="reminderWords != null">reminder_words = #{reminderWords},</if>
- <if test="bindCorpId != null">bind_corp_id = #{bindCorpId},</if>
- <if test="contactInfo != null">contact_info = #{contactInfo},</if>
- <if test="channelType != null">channel_type = #{channelType},</if>
- </trim>
- where role_id = #{roleId}
- </update>
- <delete id="deleteFastGptRoleByRoleId" parameterType="Long">
- delete from fastgpt_role where role_id = #{roleId}
- </delete>
- <delete id="deleteFastGptRoleByRoleIds" parameterType="String">
- delete from fastgpt_role where role_id in
- <foreach item="roleId" collection="array" open="(" separator="," close=")">
- #{roleId}
- </foreach>
- </delete>
- </mapper>
|