|
@@ -1,140 +1,143 @@
|
|
|
<?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.shawn.repository.TAreaMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.shawn.model.entity.TArea">
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
|
|
|
- <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
|
|
|
- <result column="orders" jdbcType="INTEGER" property="orders" />
|
|
|
- <result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
- <result column="tree_path" jdbcType="VARCHAR" property="treePath" />
|
|
|
- <result column="parent" jdbcType="BIGINT" property="parent" />
|
|
|
- <result column="code" jdbcType="VARCHAR" property="code" />
|
|
|
- </resultMap>
|
|
|
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.shawn.model.entity.TArea">
|
|
|
- <result column="full_name" jdbcType="LONGVARCHAR" property="fullName" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
- <where>
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
+ <resultMap id="BaseResultMap" type="com.shawn.model.entity.TArea">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
|
|
|
+ <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate"/>
|
|
|
+ <result column="orders" jdbcType="INTEGER" property="orders"/>
|
|
|
+ <result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
+ <result column="tree_path" jdbcType="VARCHAR" property="treePath"/>
|
|
|
+ <result column="parent" jdbcType="BIGINT" property="parent"/>
|
|
|
+ <result column="code" jdbcType="VARCHAR" property="code"/>
|
|
|
+ </resultMap>
|
|
|
+ <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.shawn.model.entity.TArea">
|
|
|
+ <result column="full_name" jdbcType="LONGVARCHAR" property="fullName"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
+ <where>
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
+ <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 close=")" collection="criterion.value" item="listItem" open="("
|
|
|
+ separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
</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="(" prefixOverrides="and" suffix=")">
|
|
|
- <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Update_By_Example_Where_Clause">
|
|
|
+ <where>
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
+ <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 close=")" collection="criterion.value" item="listItem" open="("
|
|
|
+ separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
</foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Base_Column_List">
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
id, create_date, modify_date, orders, name, tree_path, parent, code
|
|
|
</sql>
|
|
|
- <sql id="Blob_Column_List">
|
|
|
+ <sql id="Blob_Column_List">
|
|
|
full_name
|
|
|
</sql>
|
|
|
- <select id="selectByExampleWithBLOBs" parameterType="com.shawn.model.entity.TAreaExample" resultMap="ResultMapWithBLOBs">
|
|
|
- select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- ,
|
|
|
- <include refid="Blob_Column_List" />
|
|
|
- from t_area
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- <if test="orderByClause != null">
|
|
|
- order by ${orderByClause}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectByExample" parameterType="com.shawn.model.entity.TAreaExample" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from t_area
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- <if test="orderByClause != null">
|
|
|
- order by ${orderByClause}
|
|
|
- </if>
|
|
|
- <if test="limit != null">
|
|
|
- <if test="offset != null">
|
|
|
- limit ${offset}, ${limit}
|
|
|
- </if>
|
|
|
- <if test="offset == null">
|
|
|
- limit ${limit}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- ,
|
|
|
- <include refid="Blob_Column_List" />
|
|
|
- from t_area
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ <select id="selectByExampleWithBLOBs" parameterType="com.shawn.model.entity.TAreaExample"
|
|
|
+ resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ ,
|
|
|
+ <include refid="Blob_Column_List"/>
|
|
|
+ from t_area
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectByExample" parameterType="com.shawn.model.entity.TAreaExample" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from t_area
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ <if test="limit != null">
|
|
|
+ <if test="offset != null">
|
|
|
+ limit ${offset}, ${limit}
|
|
|
+ </if>
|
|
|
+ <if test="offset == null">
|
|
|
+ limit ${limit}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ ,
|
|
|
+ <include refid="Blob_Column_List"/>
|
|
|
+ from t_area
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
delete from t_area
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.shawn.model.entity.TAreaExample">
|
|
|
- delete from t_area
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.shawn.model.entity.TArea">
|
|
|
+ <delete id="deleteByExample" parameterType="com.shawn.model.entity.TAreaExample">
|
|
|
+ delete from t_area
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.shawn.model.entity.TArea">
|
|
|
insert into t_area (id, create_date, modify_date,
|
|
|
orders, name, tree_path,
|
|
|
parent, code, full_name
|
|
@@ -144,168 +147,168 @@
|
|
|
#{parent,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{fullName,jdbcType=LONGVARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.shawn.model.entity.TArea">
|
|
|
- insert into t_area
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="createDate != null">
|
|
|
- create_date,
|
|
|
- </if>
|
|
|
- <if test="modifyDate != null">
|
|
|
- modify_date,
|
|
|
- </if>
|
|
|
- <if test="orders != null">
|
|
|
- orders,
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name,
|
|
|
- </if>
|
|
|
- <if test="treePath != null">
|
|
|
- tree_path,
|
|
|
- </if>
|
|
|
- <if test="parent != null">
|
|
|
- parent,
|
|
|
- </if>
|
|
|
- <if test="code != null">
|
|
|
- code,
|
|
|
- </if>
|
|
|
- <if test="fullName != null">
|
|
|
- full_name,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createDate != null">
|
|
|
- #{createDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="modifyDate != null">
|
|
|
- #{modifyDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="orders != null">
|
|
|
- #{orders,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="treePath != null">
|
|
|
- #{treePath,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="parent != null">
|
|
|
- #{parent,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="code != null">
|
|
|
- #{code,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="fullName != null">
|
|
|
- #{fullName,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <select id="countByExample" parameterType="com.shawn.model.entity.TAreaExample" resultType="java.lang.Long">
|
|
|
- select count(*) from t_area
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
- update t_area
|
|
|
- <set>
|
|
|
- <if test="record.id != null">
|
|
|
- id = #{record.id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="record.createDate != null">
|
|
|
+ <insert id="insertSelective" parameterType="com.shawn.model.entity.TArea">
|
|
|
+ insert into t_area
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date,
|
|
|
+ </if>
|
|
|
+ <if test="modifyDate != null">
|
|
|
+ modify_date,
|
|
|
+ </if>
|
|
|
+ <if test="orders != null">
|
|
|
+ orders,
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name,
|
|
|
+ </if>
|
|
|
+ <if test="treePath != null">
|
|
|
+ tree_path,
|
|
|
+ </if>
|
|
|
+ <if test="parent != null">
|
|
|
+ parent,
|
|
|
+ </if>
|
|
|
+ <if test="code != null">
|
|
|
+ code,
|
|
|
+ </if>
|
|
|
+ <if test="fullName != null">
|
|
|
+ full_name,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="modifyDate != null">
|
|
|
+ #{modifyDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orders != null">
|
|
|
+ #{orders,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="treePath != null">
|
|
|
+ #{treePath,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="parent != null">
|
|
|
+ #{parent,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="code != null">
|
|
|
+ #{code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="fullName != null">
|
|
|
+ #{fullName,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="countByExample" parameterType="com.shawn.model.entity.TAreaExample" resultType="java.lang.Long">
|
|
|
+ select count(*) from t_area
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ update t_area
|
|
|
+ <set>
|
|
|
+ <if test="record.id != null">
|
|
|
+ id = #{record.id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="record.createDate != null">
|
|
|
+ create_date = #{record.createDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.modifyDate != null">
|
|
|
+ modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.orders != null">
|
|
|
+ orders = #{record.orders,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.name != null">
|
|
|
+ name = #{record.name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.treePath != null">
|
|
|
+ tree_path = #{record.treePath,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.parent != null">
|
|
|
+ parent = #{record.parent,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="record.code != null">
|
|
|
+ code = #{record.code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.fullName != null">
|
|
|
+ full_name = #{record.fullName,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
+ update t_area
|
|
|
+ set id = #{record.id,jdbcType=BIGINT},
|
|
|
create_date = #{record.createDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="record.modifyDate != null">
|
|
|
modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="record.orders != null">
|
|
|
orders = #{record.orders,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.name != null">
|
|
|
name = #{record.name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.treePath != null">
|
|
|
tree_path = #{record.treePath,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.parent != null">
|
|
|
parent = #{record.parent,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="record.code != null">
|
|
|
code = #{record.code,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.fullName != null">
|
|
|
- full_name = #{record.fullName,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
- update t_area
|
|
|
- set id = #{record.id,jdbcType=BIGINT},
|
|
|
- create_date = #{record.createDate,jdbcType=TIMESTAMP},
|
|
|
- modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
|
|
|
- orders = #{record.orders,jdbcType=INTEGER},
|
|
|
- name = #{record.name,jdbcType=VARCHAR},
|
|
|
- tree_path = #{record.treePath,jdbcType=VARCHAR},
|
|
|
- parent = #{record.parent,jdbcType=BIGINT},
|
|
|
- code = #{record.code,jdbcType=VARCHAR},
|
|
|
- full_name = #{record.fullName,jdbcType=LONGVARCHAR}
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
- update t_area
|
|
|
- set id = #{record.id,jdbcType=BIGINT},
|
|
|
- create_date = #{record.createDate,jdbcType=TIMESTAMP},
|
|
|
- modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
|
|
|
- orders = #{record.orders,jdbcType=INTEGER},
|
|
|
- name = #{record.name,jdbcType=VARCHAR},
|
|
|
- tree_path = #{record.treePath,jdbcType=VARCHAR},
|
|
|
- parent = #{record.parent,jdbcType=BIGINT},
|
|
|
- code = #{record.code,jdbcType=VARCHAR}
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.shawn.model.entity.TArea">
|
|
|
- update t_area
|
|
|
- <set>
|
|
|
- <if test="createDate != null">
|
|
|
- create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="modifyDate != null">
|
|
|
- modify_date = #{modifyDate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="orders != null">
|
|
|
- orders = #{orders,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name = #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="treePath != null">
|
|
|
- tree_path = #{treePath,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="parent != null">
|
|
|
- parent = #{parent,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="code != null">
|
|
|
- code = #{code,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="fullName != null">
|
|
|
- full_name = #{fullName,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.shawn.model.entity.TArea">
|
|
|
+ full_name = #{record.fullName,jdbcType=LONGVARCHAR}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ update t_area
|
|
|
+ set id = #{record.id,jdbcType=BIGINT},
|
|
|
+ create_date = #{record.createDate,jdbcType=TIMESTAMP},
|
|
|
+ modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
|
|
|
+ orders = #{record.orders,jdbcType=INTEGER},
|
|
|
+ name = #{record.name,jdbcType=VARCHAR},
|
|
|
+ tree_path = #{record.treePath,jdbcType=VARCHAR},
|
|
|
+ parent = #{record.parent,jdbcType=BIGINT},
|
|
|
+ code = #{record.code,jdbcType=VARCHAR}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.shawn.model.entity.TArea">
|
|
|
+ update t_area
|
|
|
+ <set>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="modifyDate != null">
|
|
|
+ modify_date = #{modifyDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orders != null">
|
|
|
+ orders = #{orders,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="treePath != null">
|
|
|
+ tree_path = #{treePath,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="parent != null">
|
|
|
+ parent = #{parent,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="code != null">
|
|
|
+ code = #{code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="fullName != null">
|
|
|
+ full_name = #{fullName,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.shawn.model.entity.TArea">
|
|
|
update t_area
|
|
|
set create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
modify_date = #{modifyDate,jdbcType=TIMESTAMP},
|
|
@@ -317,7 +320,7 @@
|
|
|
full_name = #{fullName,jdbcType=LONGVARCHAR}
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.shawn.model.entity.TArea">
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.shawn.model.entity.TArea">
|
|
|
update t_area
|
|
|
set create_date = #{createDate,jdbcType=TIMESTAMP},
|
|
|
modify_date = #{modifyDate,jdbcType=TIMESTAMP},
|
|
@@ -328,52 +331,68 @@
|
|
|
code = #{code,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
- <insert id="insertBatch" parameterType="java.util.List">
|
|
|
- insert into t_area (id,create_date,modify_date,orders,name,tree_path,parent,code,full_name)
|
|
|
- <foreach collection="list" index="index" item="item" separator="union all">
|
|
|
- select #{item.id,jdbcType=BIGINT},#{item.createDate,jdbcType=TIMESTAMP},#{item.modifyDate,jdbcType=TIMESTAMP},#{item.orders,jdbcType=INTEGER},#{item.name,jdbcType=VARCHAR},#{item.treePath,jdbcType=VARCHAR},#{item.parent,jdbcType=BIGINT},#{item.code,jdbcType=VARCHAR},#{item.fullName,jdbcType=LONGVARCHAR} from dual
|
|
|
- </foreach>
|
|
|
- </insert>
|
|
|
- <delete id="deleteBatchByIdList" parameterType="java.util.List">
|
|
|
- DELETE FROM t_area where id in
|
|
|
- <foreach close=")" collection="list" item="item" open="(" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
- <update id="updateBatchByIdList" parameterType="com.shawn.model.param.TAreaParam">
|
|
|
- update t_area
|
|
|
- <trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id = #{id},
|
|
|
- </if>
|
|
|
- <if test="createDate != null">
|
|
|
- create_date = #{createDate},
|
|
|
- </if>
|
|
|
- <if test="modifyDate != null">
|
|
|
- modify_date = #{modifyDate},
|
|
|
- </if>
|
|
|
- <if test="orders != null">
|
|
|
- orders = #{orders},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name = #{name},
|
|
|
- </if>
|
|
|
- <if test="treePath != null">
|
|
|
- tree_path = #{treePath},
|
|
|
- </if>
|
|
|
- <if test="parent != null">
|
|
|
- parent = #{parent},
|
|
|
- </if>
|
|
|
- <if test="code != null">
|
|
|
- code = #{code},
|
|
|
- </if>
|
|
|
- <if test="fullName != null">
|
|
|
- full_name = #{fullName},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- where id in
|
|
|
- <foreach close=")" collection="primaryKeyList" item="item" open="(" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </update>
|
|
|
+ <insert id="insertBatch" parameterType="java.util.List">
|
|
|
+ insert into t_area (id,create_date,modify_date,orders,name,tree_path,parent,code,full_name)
|
|
|
+ <foreach collection="list" index="index" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.id,jdbcType=BIGINT},#{item.createDate,jdbcType=TIMESTAMP},#{item.modifyDate,jdbcType=TIMESTAMP},#{item.orders,jdbcType=INTEGER},#{item.name,jdbcType=VARCHAR},#{item.treePath,jdbcType=VARCHAR},#{item.parent,jdbcType=BIGINT},#{item.code,jdbcType=VARCHAR},#{item.fullName,jdbcType=LONGVARCHAR}
|
|
|
+ from dual
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+ <delete id="deleteBatchByIdList" parameterType="java.util.List">
|
|
|
+ DELETE FROM t_area where id in
|
|
|
+ <foreach close=")" collection="list" item="item" open="(" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <update id="updateBatchByIdList" parameterType="com.shawn.model.param.TAreaParam">
|
|
|
+ update t_area
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date = #{createDate},
|
|
|
+ </if>
|
|
|
+ <if test="modifyDate != null">
|
|
|
+ modify_date = #{modifyDate},
|
|
|
+ </if>
|
|
|
+ <if test="orders != null">
|
|
|
+ orders = #{orders},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="treePath != null">
|
|
|
+ tree_path = #{treePath},
|
|
|
+ </if>
|
|
|
+ <if test="parent != null">
|
|
|
+ parent = #{parent},
|
|
|
+ </if>
|
|
|
+ <if test="code != null">
|
|
|
+ code = #{code},
|
|
|
+ </if>
|
|
|
+ <if test="fullName != null">
|
|
|
+ full_name = #{fullName},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id in
|
|
|
+ <foreach close=")" collection="primaryKeyList" item="item" open="(" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="getProvinceList" resultMap="ResultMapWithBLOBs">
|
|
|
+ SELECT
|
|
|
+ *
|
|
|
+ FROM
|
|
|
+ t_area b
|
|
|
+ WHERE
|
|
|
+ b.id in (
|
|
|
+ SELECT DISTINCT
|
|
|
+ (a.area_id)
|
|
|
+ FROM
|
|
|
+ t_equipment a
|
|
|
+ )
|
|
|
+ </select>
|
|
|
</mapper>
|