admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?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>