Files
zfile/src/main/resources/mapper/SystemConfigMapper.xml
zhaojun1998 61ad4b52c5 🎉 初始化提交
2019-08-19 21:57:02 +08:00

77 lines
3.9 KiB
XML

<?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="im.zhaojun.common.mapper.SystemConfigMapper">
<resultMap id="BaseResultMap" type="im.zhaojun.common.model.SystemConfig">
<!--@mbg.generated-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="site_name" jdbcType="LONGVARCHAR" property="siteName"/>
<result column="mode" jdbcType="LONGVARCHAR" property="mode" javaType="im.zhaojun.common.enums.ViewModeEnum"
typeHandler="im.zhaojun.common.enums.ViewModeEnumTypeHandler"/>
<result column="sidebarEnable" jdbcType="NUMERIC" property="sidebarEnable"/>
<result column="infoEnable" jdbcType="NUMERIC" property="infoEnable"/>
<result column="searchEnable" jdbcType="NUMERIC" property="searchEnable"/>
<result column="searchIgnoreCase" jdbcType="NUMERIC" property="searchIgnoreCase"/>
<result column="storageStrategy" jdbcType="LONGVARCHAR" property="storageStrategy" javaType="im.zhaojun.common.enums.StorageTypeEnum" typeHandler="im.zhaojun.common.enums.StorageTypeEnumTypeHandler"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, site_name, "mode", sidebarEnable, infoEnable, searchEnable, searchIgnoreCase, storageStrategy
</sql>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="im.zhaojun.common.model.SystemConfig"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into system_config (site_name, "mode", sidebarEnable,
infoEnable, searchEnable, searchIgnoreCase, storage_strategy, timeout
)
values (#{siteName,jdbcType=LONGVARCHAR}, #{mode,jdbcType=NUMERIC}, #{sidebarenable,jdbcType=NUMERIC},
#{infoenable,jdbcType=NUMERIC}, #{searchenable,jdbcType=NUMERIC}, #{searchignorecase,jdbcType=NUMERIC},
#{storageStrategy,jdbcType=LONGVARCHAR}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="im.zhaojun.common.model.SystemConfig">
<!--@mbg.generated-->
update system_config
<set>
<if test="siteName != null">
site_name = #{siteName,jdbcType=LONGVARCHAR},
</if>
<if test="mode != null">
"mode" = #{mode,jdbcType=NUMERIC},
</if>
<if test="sidebarenable != null">
sidebarEnable = #{sidebarEnable,jdbcType=NUMERIC},
</if>
<if test="infoenable != null">
infoEnable = #{infoEnable,jdbcType=NUMERIC},
</if>
<if test="searchenable != null">
searchEnable = #{searchEnable,jdbcType=NUMERIC},
</if>
<if test="searchignorecase != null">
searchIgnoreCase = #{searchIgnoreCase,jdbcType=NUMERIC},
</if>
<if test="storage_strategy != null">
storageStrategy = #{storageStrategy,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="im.zhaojun.common.model.SystemConfig">
<!--@mbg.generated-->
update system_config
set site_name = #{siteName,jdbcType=LONGVARCHAR},
"mode" = #{mode,jdbcType=NUMERIC},
sidebarEnable = #{sidebarEnable,jdbcType=NUMERIC},
infoEnable = #{infoEnable,jdbcType=NUMERIC},
searchEnable = #{searchEnable,jdbcType=NUMERIC},
searchIgnoreCase = #{searchIgnoreCase,jdbcType=NUMERIC},
storageStrategy = #{storageStrategy,jdbcType=NUMERIC}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectFirstConfig" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from system_config limit 1
</select>
</mapper>