<?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.AccountEntityMapper" >
|
<resultMap id="BaseResultMap" type="com.moral.monitor.entity.AccountEntity" >
|
<id column="id" property="id" jdbcType="INTEGER" />
|
<result column="account" property="account" jdbcType="VARCHAR" />
|
<result column="password" property="password" jdbcType="VARCHAR" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="sex" property="sex" jdbcType="VARCHAR" />
|
<result column="organization" property="organization" jdbcType="VARCHAR" />
|
<result column="email" property="email" jdbcType="VARCHAR" />
|
<result column="mobile" property="mobile" jdbcType="VARCHAR" />
|
<result column="weixin" property="weixin" jdbcType="VARCHAR" />
|
<result column="time" property="time" jdbcType="TIMESTAMP" />
|
<result column="enable" property="enable" 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, account, password, name, sex, organization, email, mobile, weixin, time, enable
|
</sql>
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.moral.monitor.entity.AccountEntityExample" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
<include refid="Base_Column_List" />
|
from account
|
<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.Integer" >
|
select
|
<include refid="Base_Column_List" />
|
from account
|
where id = #{id,jdbcType=INTEGER}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
delete from account
|
where id = #{id,jdbcType=INTEGER}
|
</delete>
|
<delete id="deleteByExample" parameterType="com.moral.monitor.entity.AccountEntityExample" >
|
delete from account
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="com.moral.monitor.entity.AccountEntity" >
|
insert into account (id, account, password,
|
name, sex, organization,
|
email, mobile, weixin,
|
time, enable)
|
values (#{id,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{organization,jdbcType=VARCHAR},
|
#{email,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{weixin,jdbcType=VARCHAR},
|
#{time,jdbcType=TIMESTAMP}, #{enable,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.moral.monitor.entity.AccountEntity" >
|
insert into account
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="account != null" >
|
account,
|
</if>
|
<if test="password != null" >
|
password,
|
</if>
|
<if test="name != null" >
|
name,
|
</if>
|
<if test="sex != null" >
|
sex,
|
</if>
|
<if test="organization != null" >
|
organization,
|
</if>
|
<if test="email != null" >
|
email,
|
</if>
|
<if test="mobile != null" >
|
mobile,
|
</if>
|
<if test="weixin != null" >
|
weixin,
|
</if>
|
<if test="time != null" >
|
time,
|
</if>
|
<if test="enable != null" >
|
enable,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=INTEGER},
|
</if>
|
<if test="account != null" >
|
#{account,jdbcType=VARCHAR},
|
</if>
|
<if test="password != null" >
|
#{password,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null" >
|
#{sex,jdbcType=VARCHAR},
|
</if>
|
<if test="organization != null" >
|
#{organization,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null" >
|
#{email,jdbcType=VARCHAR},
|
</if>
|
<if test="mobile != null" >
|
#{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="weixin != null" >
|
#{weixin,jdbcType=VARCHAR},
|
</if>
|
<if test="time != null" >
|
#{time,jdbcType=TIMESTAMP},
|
</if>
|
<if test="enable != null" >
|
#{enable,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="countByExample" parameterType="com.moral.monitor.entity.AccountEntityExample" resultType="java.lang.Integer" >
|
select count(*) from account
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update account
|
<set >
|
<if test="record.id != null" >
|
id = #{record.id,jdbcType=INTEGER},
|
</if>
|
<if test="record.account != null" >
|
account = #{record.account,jdbcType=VARCHAR},
|
</if>
|
<if test="record.password != null" >
|
password = #{record.password,jdbcType=VARCHAR},
|
</if>
|
<if test="record.name != null" >
|
name = #{record.name,jdbcType=VARCHAR},
|
</if>
|
<if test="record.sex != null" >
|
sex = #{record.sex,jdbcType=VARCHAR},
|
</if>
|
<if test="record.organization != null" >
|
organization = #{record.organization,jdbcType=VARCHAR},
|
</if>
|
<if test="record.email != null" >
|
email = #{record.email,jdbcType=VARCHAR},
|
</if>
|
<if test="record.mobile != null" >
|
mobile = #{record.mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="record.weixin != null" >
|
weixin = #{record.weixin,jdbcType=VARCHAR},
|
</if>
|
<if test="record.time != null" >
|
time = #{record.time,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.enable != null" >
|
enable = #{record.enable,jdbcType=VARCHAR},
|
</if>
|
</set>
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByExample" parameterType="map" >
|
update account
|
set id = #{record.id,jdbcType=INTEGER},
|
account = #{record.account,jdbcType=VARCHAR},
|
password = #{record.password,jdbcType=VARCHAR},
|
name = #{record.name,jdbcType=VARCHAR},
|
sex = #{record.sex,jdbcType=VARCHAR},
|
organization = #{record.organization,jdbcType=VARCHAR},
|
email = #{record.email,jdbcType=VARCHAR},
|
mobile = #{record.mobile,jdbcType=VARCHAR},
|
weixin = #{record.weixin,jdbcType=VARCHAR},
|
time = #{record.time,jdbcType=TIMESTAMP},
|
enable = #{record.enable,jdbcType=VARCHAR}
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.moral.monitor.entity.AccountEntity" >
|
update account
|
<set >
|
<if test="account != null" >
|
account = #{account,jdbcType=VARCHAR},
|
</if>
|
<if test="password != null" >
|
password = #{password,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null" >
|
sex = #{sex,jdbcType=VARCHAR},
|
</if>
|
<if test="organization != null" >
|
organization = #{organization,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null" >
|
email = #{email,jdbcType=VARCHAR},
|
</if>
|
<if test="mobile != null" >
|
mobile = #{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="weixin != null" >
|
weixin = #{weixin,jdbcType=VARCHAR},
|
</if>
|
<if test="time != null" >
|
time = #{time,jdbcType=TIMESTAMP},
|
</if>
|
<if test="enable != null" >
|
enable = #{enable,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.moral.monitor.entity.AccountEntity" >
|
update account
|
set account = #{account,jdbcType=VARCHAR},
|
password = #{password,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
sex = #{sex,jdbcType=VARCHAR},
|
organization = #{organization,jdbcType=VARCHAR},
|
email = #{email,jdbcType=VARCHAR},
|
mobile = #{mobile,jdbcType=VARCHAR},
|
weixin = #{weixin,jdbcType=VARCHAR},
|
time = #{time,jdbcType=TIMESTAMP},
|
enable = #{enable,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
</mapper>
|