<?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.nanometer.smartlab.dao.EncodeReplaceDictMapper" >
|
<resultMap id="BaseResultMap" type="com.nanometer.smartlab.entity.EncodeReplaceDict" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="type" property="type" typeHandler="com.nanometer.smartlab.entity.handler.ReplaceDictTypeHandler" />
|
<result column="number" property="number" jdbcType="VARCHAR" />
|
<result column="info" property="info" jdbcType="VARCHAR" />
|
<result column="abbreviation" property="abbreviation" jdbcType="VARCHAR" />
|
<result column="creator" property="creator" jdbcType="VARCHAR" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="valid_flag" property="validFlag" jdbcType="INTEGER" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, type, number, info, abbreviation, creator, update_time, valid_flag
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from sys_encode_replace_dict
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectAll" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from sys_encode_replace_dict
|
<where>
|
valid_flag =1
|
<if test="info != null and info != ''">
|
and info like concat("%",#{info},"%")
|
</if>
|
<!-- 精确查询 -->
|
<if test="p_info != null and p_info != ''">
|
and info = #{p_info}
|
</if>
|
<if test="number != null and number != ''">
|
and number like concat("%",#{number},"%")
|
</if>
|
<!-- 精确查询 -->
|
<if test="p_number != null and p_number != ''">
|
and number = #{p_number}
|
</if>
|
<if test="type != null">
|
and type = #{type}
|
</if>
|
</where>
|
|
order by update_time desc
|
<if test="first != null and pageSize != null">
|
limit #{first},#{pageSize}
|
</if>
|
</select>
|
<select id="countAll" resultType="java.lang.Integer">
|
select count(1)
|
from sys_encode_replace_dict
|
<where>
|
valid_flag =1
|
<if test="info != null and info != ''">
|
and info like concat("%",#{info},"%")
|
</if>
|
<if test="number != null and number != ''">
|
and number like concat("%",#{number},"%")
|
</if>
|
<if test="type != null">
|
and type = #{type}
|
</if>
|
</where>
|
|
</select>
|
<select id="findByCondition" resultType="java.lang.Integer" parameterType="java.util.Map">
|
select count(1)
|
from sys_encode_replace_dict
|
<where>
|
valid_flag =1
|
<if test="info != null and info != ''">
|
and info like concat("%",#{info},"%")
|
</if>
|
<if test="number != null and number != ''">
|
and number like concat("%",#{number},"%")
|
</if>
|
<if test="type != null">
|
and type = #{type}
|
</if>
|
</where>
|
</select>
|
<update id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
<!-- -->
|
update sys_encode_replace_dict set valid_flag = 0
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<insert id="insert" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" useGeneratedKeys = "true" keyProperty = "id">
|
<!-- -->
|
insert into sys_encode_replace_dict (type, number,
|
info, abbreviation, creator,
|
update_time, valid_flag)
|
values (#{type}, #{number,jdbcType=VARCHAR},
|
#{info,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
|
#{updateTime,jdbcType=TIMESTAMP}, 1)
|
</insert>
|
<insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
|
<!-- -->
|
insert into sys_encode_replace_dict
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="number != null" >
|
number,
|
</if>
|
<if test="info != null" >
|
info,
|
</if>
|
<if test="abbreviation != null" >
|
abbreviation,
|
</if>
|
<if test="creator != null" >
|
creator,
|
</if>
|
<if test="updateTime != null" >
|
update_time,
|
</if>
|
<if test="validFlag != null" >
|
valid_flag,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="type != null" >
|
#{type},
|
</if>
|
<if test="number != null" >
|
#{number,jdbcType=VARCHAR},
|
</if>
|
<if test="info != null" >
|
#{info,jdbcType=VARCHAR},
|
</if>
|
<if test="abbreviation != null" >
|
#{abbreviation,jdbcType=VARCHAR},
|
</if>
|
<if test="creator != null" >
|
#{creator,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null" >
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="validFlag != null" >
|
#{validFlag,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
|
<!-- -->
|
update sys_encode_replace_dict
|
<set >
|
<if test="type != null" >
|
type = #{type},
|
</if>
|
<if test="number != null" >
|
number = #{number,jdbcType=VARCHAR},
|
</if>
|
<if test="info != null" >
|
info = #{info,jdbcType=VARCHAR},
|
</if>
|
<if test="abbreviation != null" >
|
abbreviation = #{abbreviation,jdbcType=VARCHAR},
|
</if>
|
<if test="creator != null" >
|
creator = #{creator,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null" >
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="validFlag != null" >
|
valid_flag = #{validFlag,jdbcType=INTEGER},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.nanometer.smartlab.entity.EncodeReplaceDict" >
|
<!-- -->
|
update sys_encode_replace_dict
|
set type = #{type},
|
number = #{number,jdbcType=VARCHAR},
|
info = #{info,jdbcType=VARCHAR},
|
abbreviation = #{abbreviation,jdbcType=VARCHAR},
|
creator = #{creator,jdbcType=VARCHAR},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
valid_flag = #{validFlag,jdbcType=INTEGER}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|