<?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.moral.monitor.dao.OrganizationMapper" >
|
<resultMap id="BaseResultMap" type="com.moral.monitor.entity.Organization" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="code" property="code" jdbcType="VARCHAR" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="VARCHAR" />
|
<result column="rank" property="rank" jdbcType="VARCHAR" />
|
<result column="establishtime" property="establishtime" jdbcType="TIMESTAMP" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="establishuser" property="establishuser" jdbcType="VARCHAR" />
|
<result column="updateuser" property="updateuser" jdbcType="VARCHAR" />
|
<result column="pid" property="pid" jdbcType="VARCHAR" />
|
<result column="areacode" property="areacode" jdbcType="VARCHAR" />
|
<result column="address" property="address" jdbcType="VARCHAR" />
|
<result column="telephone" property="telephone" jdbcType="VARCHAR" />
|
<result column="email" property="email" jdbcType="VARCHAR" />
|
<result column="enable" property="enable" jdbcType="INTEGER" />
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
</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, code, name, type, rank, establishtime, updatetime, establishuser, updateuser,
|
pid, areacode, address, telephone, email, enable, remark
|
</sql>
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.moral.monitor.entity.OrganizationExample" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
organization.*
|
from organization
|
LEFT JOIN area ON organization.areacode = area.`code`
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
<if test="orderByClause != null" >
|
order by ${orderByClause}
|
</if>
|
</select>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
select
|
<include refid="Base_Column_List" />
|
from organization
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
delete from organization
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
<delete id="deleteByExample" parameterType="com.moral.monitor.entity.OrganizationExample" >
|
delete from organization
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="com.moral.monitor.entity.Organization" >
|
insert into organization (id, code, name,
|
type, rank, establishtime,
|
updatetime, establishuser, updateuser,
|
pid, areacode, address,
|
telephone, email, enable,
|
remark)
|
values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
#{type,jdbcType=VARCHAR}, #{rank,jdbcType=VARCHAR}, #{establishtime,jdbcType=TIMESTAMP},
|
#{updatetime,jdbcType=TIMESTAMP}, #{establishuser,jdbcType=VARCHAR}, #{updateuser,jdbcType=VARCHAR},
|
#{pid,jdbcType=VARCHAR}, #{areacode,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
#{telephone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{enable,jdbcType=INTEGER},
|
#{remark,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.moral.monitor.entity.Organization" >
|
insert into organization
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="code != null" >
|
code,
|
</if>
|
<if test="name != null" >
|
name,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="rank != null" >
|
rank,
|
</if>
|
<if test="establishtime != null" >
|
establishtime,
|
</if>
|
<if test="updatetime != null" >
|
updatetime,
|
</if>
|
<if test="establishuser != null" >
|
establishuser,
|
</if>
|
<if test="updateuser != null" >
|
updateuser,
|
</if>
|
<if test="pid != null" >
|
pid,
|
</if>
|
<if test="areacode != null" >
|
areacode,
|
</if>
|
<if test="address != null" >
|
address,
|
</if>
|
<if test="telephone != null" >
|
telephone,
|
</if>
|
<if test="email != null" >
|
email,
|
</if>
|
<if test="enable != null" >
|
enable,
|
</if>
|
<if test="remark != null" >
|
remark,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="code != null" >
|
#{code,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=VARCHAR},
|
</if>
|
<if test="rank != null" >
|
#{rank,jdbcType=VARCHAR},
|
</if>
|
<if test="establishtime != null" >
|
#{establishtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatetime != null" >
|
#{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="establishuser != null" >
|
#{establishuser,jdbcType=VARCHAR},
|
</if>
|
<if test="updateuser != null" >
|
#{updateuser,jdbcType=VARCHAR},
|
</if>
|
<if test="pid != null" >
|
#{pid,jdbcType=VARCHAR},
|
</if>
|
<if test="areacode != null" >
|
#{areacode,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null" >
|
#{address,jdbcType=VARCHAR},
|
</if>
|
<if test="telephone != null" >
|
#{telephone,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null" >
|
#{email,jdbcType=VARCHAR},
|
</if>
|
<if test="enable != null" >
|
#{enable,jdbcType=INTEGER},
|
</if>
|
<if test="remark != null" >
|
#{remark,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="countByExample" parameterType="com.moral.monitor.entity.OrganizationExample" resultType="java.lang.Integer" >
|
select count(*) from organization
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update organization
|
<set >
|
<if test="record.id != null" >
|
id = #{record.id,jdbcType=VARCHAR},
|
</if>
|
<if test="record.code != null" >
|
code = #{record.code,jdbcType=VARCHAR},
|
</if>
|
<if test="record.name != null" >
|
name = #{record.name,jdbcType=VARCHAR},
|
</if>
|
<if test="record.type != null" >
|
type = #{record.type,jdbcType=VARCHAR},
|
</if>
|
<if test="record.rank != null" >
|
rank = #{record.rank,jdbcType=VARCHAR},
|
</if>
|
<if test="record.establishtime != null" >
|
establishtime = #{record.establishtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.updatetime != null" >
|
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.establishuser != null" >
|
establishuser = #{record.establishuser,jdbcType=VARCHAR},
|
</if>
|
<if test="record.updateuser != null" >
|
updateuser = #{record.updateuser,jdbcType=VARCHAR},
|
</if>
|
<if test="record.pid != null" >
|
pid = #{record.pid,jdbcType=VARCHAR},
|
</if>
|
<if test="record.areacode != null" >
|
areacode = #{record.areacode,jdbcType=VARCHAR},
|
</if>
|
<if test="record.address != null" >
|
address = #{record.address,jdbcType=VARCHAR},
|
</if>
|
<if test="record.telephone != null" >
|
telephone = #{record.telephone,jdbcType=VARCHAR},
|
</if>
|
<if test="record.email != null" >
|
email = #{record.email,jdbcType=VARCHAR},
|
</if>
|
<if test="record.enable != null" >
|
enable = #{record.enable,jdbcType=INTEGER},
|
</if>
|
<if test="record.remark != null" >
|
remark = #{record.remark,jdbcType=VARCHAR},
|
</if>
|
</set>
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByExample" parameterType="map" >
|
update organization
|
set id = #{record.id,jdbcType=VARCHAR},
|
code = #{record.code,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
type = #{record.type,jdbcType=VARCHAR},
|
rank = #{record.rank,jdbcType=VARCHAR},
|
establishtime = #{record.establishtime,jdbcType=TIMESTAMP},
|
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
establishuser = #{record.establishuser,jdbcType=VARCHAR},
|
updateuser = #{record.updateuser,jdbcType=VARCHAR},
|
pid = #{record.pid,jdbcType=VARCHAR},
|
areacode = #{record.areacode,jdbcType=VARCHAR},
|
address = #{record.address,jdbcType=VARCHAR},
|
telephone = #{record.telephone,jdbcType=VARCHAR},
|
email = #{record.email,jdbcType=VARCHAR},
|
enable = #{record.enable,jdbcType=INTEGER},
|
remark = #{record.remark,jdbcType=VARCHAR}
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.moral.monitor.entity.Organization" >
|
update organization
|
<set >
|
<if test="code != null" >
|
code = #{code,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
<if test="rank != null" >
|
rank = #{rank,jdbcType=VARCHAR},
|
</if>
|
<if test="establishtime != null" >
|
establishtime = #{establishtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatetime != null" >
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="establishuser != null" >
|
establishuser = #{establishuser,jdbcType=VARCHAR},
|
</if>
|
<if test="updateuser != null" >
|
updateuser = #{updateuser,jdbcType=VARCHAR},
|
</if>
|
<if test="pid != null" >
|
pid = #{pid,jdbcType=VARCHAR},
|
</if>
|
<if test="areacode != null" >
|
areacode = #{areacode,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null" >
|
address = #{address,jdbcType=VARCHAR},
|
</if>
|
<if test="telephone != null" >
|
telephone = #{telephone,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null" >
|
email = #{email,jdbcType=VARCHAR},
|
</if>
|
<if test="enable != null" >
|
enable = #{enable,jdbcType=INTEGER},
|
</if>
|
<if test="remark != null" >
|
remark = #{remark,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.moral.monitor.entity.Organization" >
|
update organization
|
set code = #{code,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
rank = #{rank,jdbcType=VARCHAR},
|
establishtime = #{establishtime,jdbcType=TIMESTAMP},
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
establishuser = #{establishuser,jdbcType=VARCHAR},
|
updateuser = #{updateuser,jdbcType=VARCHAR},
|
pid = #{pid,jdbcType=VARCHAR},
|
areacode = #{areacode,jdbcType=VARCHAR},
|
address = #{address,jdbcType=VARCHAR},
|
telephone = #{telephone,jdbcType=VARCHAR},
|
email = #{email,jdbcType=VARCHAR},
|
enable = #{enable,jdbcType=INTEGER},
|
remark = #{remark,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|