<?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="cn.com.basic.dao.SysLogMapper" >
|
<resultMap id="BaseResultMap" type="cn.com.basic.entity.SysLog" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="content" property="content" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="TINYINT" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="user_id" property="userId" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="TINYINT" />
|
<result column="is_valid" property="isValid" jdbcType="TINYINT" />
|
</resultMap>
|
<sql id="Example_Where_Clause" >
|
<where >
|
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
<if test="criteria.valid" >
|
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
<foreach collection="criteria.criteria" item="criterion" >
|
<choose >
|
<when test="criterion.noValue" >
|
and ${criterion.condition}
|
</when>
|
<when test="criterion.singleValue" >
|
and ${criterion.condition} #{criterion.value}
|
</when>
|
<when test="criterion.betweenValue" >
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
</when>
|
<when test="criterion.listValue" >
|
and ${criterion.condition}
|
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
#{listItem}
|
</foreach>
|
</when>
|
</choose>
|
</foreach>
|
</trim>
|
</if>
|
</foreach>
|
</where>
|
</sql>
|
<sql id="Update_By_Example_Where_Clause" >
|
<where >
|
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
<if test="criteria.valid" >
|
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
<foreach collection="criteria.criteria" item="criterion" >
|
<choose >
|
<when test="criterion.noValue" >
|
and ${criterion.condition}
|
</when>
|
<when test="criterion.singleValue" >
|
and ${criterion.condition} #{criterion.value}
|
</when>
|
<when test="criterion.betweenValue" >
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
</when>
|
<when test="criterion.listValue" >
|
and ${criterion.condition}
|
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
#{listItem}
|
</foreach>
|
</when>
|
</choose>
|
</foreach>
|
</trim>
|
</if>
|
</foreach>
|
</where>
|
</sql>
|
<sql id="Base_Column_List" >
|
id, content, type, create_time, user_id, status, is_valid
|
</sql>
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="cn.com.basic.entity.SysLogExample" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
<include refid="Base_Column_List" />
|
from t_sys_log
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
<if test="orderByClause != null" >
|
order by ${orderByClause}
|
</if>
|
<if test="limitStart != null and limitStart>=0" >
|
limit #{limitStart} , #{limitEnd}
|
</if>
|
</select>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
select
|
<include refid="Base_Column_List" />
|
from t_sys_log
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
delete from t_sys_log
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
<delete id="deleteByExample" parameterType="cn.com.basic.entity.SysLogExample" >
|
delete from t_sys_log
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="cn.com.basic.entity.SysLog" >
|
insert into t_sys_log (id, content, type,
|
create_time, user_id, status,
|
is_valid)
|
values (#{id,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
|
#{createTime,jdbcType=TIMESTAMP}, #{userId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
|
#{isValid,jdbcType=TINYINT})
|
</insert>
|
<insert id="insertSelective" parameterType="cn.com.basic.entity.SysLog" >
|
insert into t_sys_log
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="content != null" >
|
content,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="createTime != null" >
|
create_time,
|
</if>
|
<if test="userId != null" >
|
user_id,
|
</if>
|
<if test="status != null" >
|
status,
|
</if>
|
<if test="isValid != null" >
|
is_valid,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="content != null" >
|
#{content,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=TINYINT},
|
</if>
|
<if test="createTime != null" >
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="userId != null" >
|
#{userId,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
#{status,jdbcType=TINYINT},
|
</if>
|
<if test="isValid != null" >
|
#{isValid,jdbcType=TINYINT},
|
</if>
|
</trim>
|
</insert>
|
<select id="countByExample" parameterType="cn.com.basic.entity.SysLogExample" resultType="java.lang.Integer" >
|
select count(*) from t_sys_log
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update t_sys_log
|
<set >
|
<if test="record.id != null" >
|
id = #{record.id,jdbcType=VARCHAR},
|
</if>
|
<if test="record.content != null" >
|
content = #{record.content,jdbcType=VARCHAR},
|
</if>
|
<if test="record.type != null" >
|
type = #{record.type,jdbcType=TINYINT},
|
</if>
|
<if test="record.createTime != null" >
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.userId != null" >
|
user_id = #{record.userId,jdbcType=VARCHAR},
|
</if>
|
<if test="record.status != null" >
|
status = #{record.status,jdbcType=TINYINT},
|
</if>
|
<if test="record.isValid != null" >
|
is_valid = #{record.isValid,jdbcType=TINYINT},
|
</if>
|
</set>
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByExample" parameterType="map" >
|
update t_sys_log
|
set id = #{record.id,jdbcType=VARCHAR},
|
content = #{record.content,jdbcType=VARCHAR},
|
type = #{record.type,jdbcType=TINYINT},
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
user_id = #{record.userId,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=TINYINT},
|
is_valid = #{record.isValid,jdbcType=TINYINT}
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="cn.com.basic.entity.SysLog" >
|
update t_sys_log
|
<set >
|
<if test="content != null" >
|
content = #{content,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
type = #{type,jdbcType=TINYINT},
|
</if>
|
<if test="createTime != null" >
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="userId != null" >
|
user_id = #{userId,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
status = #{status,jdbcType=TINYINT},
|
</if>
|
<if test="isValid != null" >
|
is_valid = #{isValid,jdbcType=TINYINT},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="cn.com.basic.entity.SysLog" >
|
update t_sys_log
|
set content = #{content,jdbcType=VARCHAR},
|
type = #{type,jdbcType=TINYINT},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
user_id = #{userId,jdbcType=VARCHAR},
|
status = #{status,jdbcType=TINYINT},
|
is_valid = #{isValid,jdbcType=TINYINT}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|