|
- <?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.imitate.common.sys.mapper.SysConfigMapper">
- <resultMap id="BaseResultMap"
- type="com.imitate.common.sys.pojo.SysConfig">
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="val" property="val" jdbcType="VARCHAR" />
- <result column="expire_in" property="expireIn"
- jdbcType="INTEGER" />
- <result column="expire_time" property="expireTime"
- jdbcType="TIMESTAMP" />
- <result column="create_time" property="createTime"
- jdbcType="TIMESTAMP" />
- <result column="update_time" property="updateTime"
- jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="CHAR" />
- </resultMap>
- <sql id="Base_Column_List">
- id, name, val, expire_in, expire_time, create_time,
- update_time, status
- </sql>
-
-
- <insert id="insert"
- parameterType="com.imitate.common.sys.pojo.SysConfig">
- insert into sys_config (id, name, val,
- expire_in,
- expire_time, create_time,
- update_time, status
- values
- (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
- #{val,jdbcType=VARCHAR},
- #{expireIn,jdbcType=INTEGER},
- #{expireTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
- #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=CHAR})
- </insert>
- <insert id="insertSelective"
- parameterType="com.imitate.common.sys.pojo.SysConfig">
- insert into sys_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="val != null">
- val,
- </if>
- <if test="expireIn != null">
- expire_in,
- </if>
- <if test="expireTime != null">
- expire_time,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="status != null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="val != null">
- #{val,jdbcType=VARCHAR},
- </if>
- <if test="expireIn != null">
- #{expireIn,jdbcType=INTEGER},
- </if>
- <if test="expireTime != null">
- #{expireTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- #{status,jdbcType=CHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective"
- parameterType="com.imitate.common.sys.pojo.SysConfig">
- update sys_config
- <set>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="val != null">
- val = #{val,jdbcType=VARCHAR},
- </if>
- <if test="expireIn != null">
- expire_in = #{expireIn,jdbcType=INTEGER},
- </if>
- <if test="expireTime != null">
- expire_time = #{expireTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=CHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey"
- parameterType="com.imitate.common.sys.pojo.SysConfig">
- update sys_config
- set name = #{name,jdbcType=VARCHAR},
- val = #{val,jdbcType=VARCHAR},
- expire_in =
- #{expireIn,jdbcType=INTEGER},
- expire_time =
- #{expireTime,jdbcType=TIMESTAMP},
- create_time =
- #{createTime,jdbcType=TIMESTAMP},
- update_time =
- #{updateTime,jdbcType=TIMESTAMP},
- status = #{status,jdbcType=CHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
-
- <select id="selectSysConfigForUpdate" resultMap="BaseResultMap"
- parameterType="java.lang.String">
- select
- <include refid="Base_Column_List" />
- from sys_config
- where name = #{name,jdbcType=VARCHAR}
- for update
- </select>
-
- <select id="selectSysConfigByName" resultMap="BaseResultMap"
- parameterType="java.lang.String">
- select
- <include refid="Base_Column_List" />
- from sys_config
- where name = #{name,jdbcType=VARCHAR}
- </select>
-
- <select id="selectAllSysConfig" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_config
- </select>
- </mapper>
|