123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.opt.mapper.SysInfoConfigMapper">
- <resultMap type="SysInfoConfig" id="SysInfoConfigResult">
- <result property="confId" column="conf_id" />
- <result property="typeCd" column="type_cd" />
- <result property="sceneTpCd" column="scene_tp_cd" />
- <result property="sceneTpNm" column="scene_tp_nm" />
- <result property="content" column="content" />
- <result property="status" column="status" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectSysInfoConfigVo">
- select c.conf_id, c.type_cd, c.scene_tp_cd, c.content, c.STATUS, c.create_by, c.create_time, c.update_by, c.update_time,
- (SELECT a.dict_label FROM sys_dict_data a WHERE a.dict_value = c.scene_tp_cd
- AND a.dict_type = (SELECT d.child_dict_type FROM sys_dict_data d WHERE d.dict_type = 'sys_tp_cd' AND d.dict_value = c.type_cd)
- ) AS scene_tp_nm
- FROM
- sys_info_config c
- </sql>
- <select id="selectSysInfoConfigList" parameterType="SysInfoConfig" resultMap="SysInfoConfigResult">
- <include refid="selectSysInfoConfigVo"/>
- <where>
- <if test="typeCd != null and typeCd != ''"> and c.type_cd = #{typeCd}</if>
- <if test="sceneTpCd != null and sceneTpCd != ''"> and c.scene_tp_cd = #{sceneTpCd}</if>
- <if test="content != null and content != ''"> and c.content = #{content}</if>
- <if test="status != null and status != ''"> and c.status = #{status}</if>
- </where>
- </select>
- <select id="selectSysInfoConfigByConfId" parameterType="Long" resultMap="SysInfoConfigResult">
- <include refid="selectSysInfoConfigVo"/>
- where c.conf_id = #{confId}
- </select>
- <insert id="insertSysInfoConfig" parameterType="SysInfoConfig" useGeneratedKeys="true" keyProperty="confId">
- insert into sys_info_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="typeCd != null">type_cd,</if>
- <if test="sceneTpCd != null">scene_tp_cd,</if>
- <if test="content != null">content,</if>
- <if test="status != null">status,</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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="typeCd != null">#{typeCd},</if>
- <if test="sceneTpCd != null">#{sceneTpCd},</if>
- <if test="content != null">#{content},</if>
- <if test="status != null">#{status},</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>
- </trim>
- </insert>
- <update id="updateSysInfoConfig" parameterType="SysInfoConfig">
- update sys_info_config
- <trim prefix="SET" suffixOverrides=",">
- <if test="typeCd != null">type_cd = #{typeCd},</if>
- <if test="sceneTpCd != null">scene_tp_cd = #{sceneTpCd},</if>
- <if test="content != null">content = #{content},</if>
- <if test="status != null">status = #{status},</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>
- </trim>
- where conf_id = #{confId}
- </update>
- <delete id="deleteSysInfoConfigByConfId" parameterType="Long">
- delete from sys_info_config where conf_id = #{confId}
- </delete>
- <delete id="deleteSysInfoConfigByConfIds" parameterType="String">
- delete from sys_info_config where conf_id in
- <foreach item="confId" collection="array" open="(" separator="," close=")">
- #{confId}
- </foreach>
- </delete>
- <resultMap type="ConfigDictData" id="ConfigDictDataResult">
- <result property="v" column="dict_value" />
- <result property="n" column="dict_label" />
- <result property="childDictType" column="child_dict_type" />
- </resultMap>
- <select id="selectDictDataListByDictType" parameterType="String" resultMap="ConfigDictDataResult">
- select d.dict_value, d.dict_label ,d.child_dict_type from sys_dict_data d where d.dict_type = #{dictType}
- </select>
- <select id="checkSysConfigExistByTypeCdAndSceneTpCd" parameterType="SysInfoConfig" resultType="int">
- select count(1) from sys_info_config s where s.type_cd = #{typeCd} and s.scene_tp_cd = #{sceneTpCd}
- <if test="confId != null">
- and s.conf_id != #{confId}
- </if>
- </select>
- </mapper>
|