123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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.simuwang.base.mapper.system.SysConfigMapper">
-
- <resultMap type="com.simuwang.base.pojo.dos.SysConfigDO" id="SysConfigResult">
- <id property="configId" column="config_id" />
- <result property="configName" column="config_name" />
- <result property="configKey" column="config_key" />
- <result property="configValue" column="config_value" />
- <result property="configType" column="config_type" />
- <result property="creatorId" column="creatorid" />
- <result property="createTime" column="createtime" />
- <result property="updaterId" column="updaterid" />
- <result property="updateTime" column="updatetime" />
- <result property="isvalid" column="isvalid" />
- </resultMap>
-
- <sql id="selectConfigDo">
- select config_id, config_name, config_key, config_value, config_type, creatorid, createtime, updaterid, updatetime, remark,isvalid
- from PPW_EMAIL.sys_config
- </sql>
-
- <!-- 查询条件 -->
- <sql id="sqlwhereSearch">
- <where>
- isvalid=1
- <if test="configId !=null">
- and config_id = #{configId}
- </if>
- <if test="configKey !=null and configKey != ''">
- and config_key = #{configKey}
- </if>
- </where>
- </sql>
-
- <select id="selectConfig" parameterType="com.simuwang.base.pojo.dos.SysConfigDO" resultMap="SysConfigResult">
- <include refid="selectConfigDo"/>
- <include refid="sqlwhereSearch"/>
- </select>
-
- <select id="selectConfigList" resultMap="SysConfigResult">
- <include refid="selectConfigDo"/>
- <where>
- isvalid=1
- <if test="configName != null and configName != ''">
- AND config_name like concat('%', #{configName}, '%')
- </if>
- <if test="configKey != null and configKey != ''">
- AND config_key like concat('%', #{configKey}, '%')
- </if>
- </where>
- limit #{offset},#{pageSize}
- </select>
-
- <select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
- <include refid="selectConfigDo"/>
- where config_id = #{configId} and isvalid =1
- </select>
-
- <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
- <include refid="selectConfigDo"/>
- where config_key = #{configKey} and isvalid =1 limit 1
- </select>
- <select id="selectConfigByKey" resultType="java.lang.String">
- </select>
- <select id="countConfigList" resultType="java.lang.Long">
- select count(1) from PPW_EMAIL.sys_config
- <where>
- isvalid=1
- <if test="configName != null and configName != ''">
- AND config_name like concat('%', #{configName}, '%')
- </if>
- <if test="configKey != null and configKey != ''">
- AND config_key like concat('%', #{configKey}, '%')
- </if>
- </where>
- </select>
- <insert id="insertConfig" parameterType="com.simuwang.base.pojo.dos.SysConfigDO">
- insert into sys_config (
- <if test="configName != null and configName != '' ">config_name,</if>
- <if test="configKey != null and configKey != '' ">config_key,</if>
- <if test="configValue != null and configValue != '' ">config_value,</if>
- <if test="configType != null and configType != '' ">config_type,</if>
- <if test="creatorId != null and creatorId != ''">creatorid,</if>
- <if test="updaterId != null and updaterId != ''">updaterid,</if>
- <if test="remark != null and remark != ''">remark,</if>
- isvalid,
- createtime,
- updatetime
- )values(
- <if test="configName != null and configName != ''">#{configName},</if>
- <if test="configKey != null and configKey != ''">#{configKey},</if>
- <if test="configValue != null and configValue != ''">#{configValue},</if>
- <if test="configType != null and configType != ''">#{configType},</if>
- <if test="creatorId != null and creatorId != ''">#{creatorId},</if>
- <if test="updaterId != null and updaterId != ''">#{updaterId},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- 1,
- sysdate(),
- sysdate()
- )
- </insert>
-
- <update id="updateConfig" parameterType="com.simuwang.base.pojo.dos.SysConfigDO">
- update sys_config
- <set>
- <if test="configName != null and configName != ''">config_name = #{configName},</if>
- <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
- <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
- <if test="configType != null and configType != ''">config_type = #{configType},</if>
- <if test="updaterId != null and updaterId != ''">updaterid = #{updaterId},</if>
- <if test="remark != null">remark = #{remark},</if>
- updatetime = sysdate()
- </set>
- where config_id = #{configId} and isvalid=1
- </update>
-
- <delete id="deleteConfigById" parameterType="Long">
- UPDATE sys_config SET isvalid=0 where config_id = #{configId}
- </delete>
-
- <delete id="deleteConfigByIds" parameterType="Long">
- UPDATE sys_config SET isvalid=0,updaterid=#{userId} where config_id in
- <foreach item="configId" collection="configIds" open="(" separator="," close=")">
- #{configId}
- </foreach>
- </delete>
-
- </mapper>
|