<?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.yeshi.fanli.dao.mybatis.AdminUserMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.common.AdminUser">
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="account" property="account" jdbcType="VARCHAR" />
|
<result column="pwd" property="pwd" jdbcType="VARCHAR" />
|
<result column="createtime" property="createtime" jdbcType="VARCHAR" />
|
<result column="authority" property="authority" jdbcType="INTEGER" />
|
<result column="id" property="id" jdbcType="BIGINT" />
|
<result column="email" property="email" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List">id,`name`,`account`,`pwd`,createtime,authority,`email`</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_adminuser where id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_adminuser where id = #{id,jdbcType=BIGINT}</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.common.AdminUser"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_adminuser
|
(id,`name`,`account`,`pwd`,createtime,authority,`email`) values
|
(#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{account,jdbcType=VARCHAR},
|
#{pwd,jdbcType=VARCHAR},#{createtime,jdbcType=VARCHAR},#{authority,jdbcType=INTEGER},#{email,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.AdminUser"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_adminuser
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="name != null">`name`,</if>
|
<if test="account != null">`account`,</if>
|
<if test="pwd != null">`pwd`,</if>
|
<if test="createtime != null">createtime,</if>
|
<if test="authority != null">authority,</if>
|
<if test="email != null">`email`,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
<if test="account != null">#{account,jdbcType=VARCHAR},</if>
|
<if test="pwd != null">#{pwd,jdbcType=VARCHAR},</if>
|
<if test="createtime != null">#{createtime,jdbcType=VARCHAR},</if>
|
<if test="authority != null">#{authority,jdbcType=INTEGER},</if>
|
<if test="email != null">#{email,jdbcType=VARCHAR}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.common.AdminUser">update
|
yeshi_ec_adminuser set `name` = #{name,jdbcType=VARCHAR},`account` =
|
#{account,jdbcType=VARCHAR}, `pwd` = #{pwd,jdbcType=VARCHAR},createtime
|
= #{createtime,jdbcType=VARCHAR}, authority =
|
#{authority,jdbcType=INTEGER} ,`email` =#{email,jdbcType=VARCHAR} where
|
id = #{id,jdbcType=BIGINT}</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.AdminUser">
|
update yeshi_ec_adminuser
|
<set>
|
<if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
|
<if test="account != null">`account`=#{account,jdbcType=VARCHAR},</if>
|
<if test="pwd != null">`pwd`=#{pwd,jdbcType=VARCHAR},</if>
|
<if test="createtime != null">createtime=#{createtime,jdbcType=VARCHAR},</if>
|
<if test="authority != null">authority=#{authority,jdbcType=INTEGER},</if>
|
<if test="id !=null">id =#{id,jdbcType=BIGINT},</if>
|
<if test="email !=null">`email` =#{email,jdbcType=VARCHAR},</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="getByAccountAndPwd" resultMap="BaseResultMap">
|
SELECT * FROM yeshi_ec_adminuser u
|
WHERE u.`account` = #{account} AND u.`pwd`= #{pwd}
|
LIMIT 1
|
</select>
|
</mapper>
|