|
|
@@ -0,0 +1,116 @@
|
|
|
+<?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.usoftchina.saas.account.mapper.AccountMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.account.po.Account">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="company_id" jdbcType="BIGINT" property="companyId"/>
|
|
|
+ <result column="username" jdbcType="VARCHAR" property="username"/>
|
|
|
+ <result column="password" jdbcType="VARCHAR" property="password"/>
|
|
|
+ <result column="salt" jdbcType="VARCHAR" property="salt"/>
|
|
|
+ <result column="realname" jdbcType="VARCHAR" property="realname"/>
|
|
|
+ <result column="email" jdbcType="VARCHAR" property="email"/>
|
|
|
+ <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
|
|
|
+ <result column="type" jdbcType="INT" property="type"/>
|
|
|
+ <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="baseColumns">
|
|
|
+ id,company_id,username,password,salt,realname,email,mobile,type,creator_id,create_time,updater_id,update_time
|
|
|
+ </sql>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.account.po.Account">
|
|
|
+ insert into ac_account(company_id,username,password,salt,realname,email,mobile,type,creator_id,create_time,updater_id,update_time)
|
|
|
+ values (#{companyId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR},#{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR},
|
|
|
+ #{realname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{type,jdbcType=INT},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.account.po.Account">
|
|
|
+ insert into ac_account
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyId != null">
|
|
|
+ company_id,
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ username,
|
|
|
+ </if>
|
|
|
+ <if test="password != null">
|
|
|
+ password,
|
|
|
+ </if>
|
|
|
+ <if test="salt != null">
|
|
|
+ salt,
|
|
|
+ </if>
|
|
|
+ <if test="realname != null">
|
|
|
+ realname,
|
|
|
+ </if>
|
|
|
+ <if test="email != null">
|
|
|
+ email,
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null">
|
|
|
+ mobile,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="creator_id != null">
|
|
|
+ creator_id,
|
|
|
+ </if>
|
|
|
+ <if test="create_time != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updater_id != null">
|
|
|
+ updater_id,
|
|
|
+ </if>
|
|
|
+ <if test="update_time != null">
|
|
|
+ update_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="companyId != null">
|
|
|
+ #{companyId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="password != null">
|
|
|
+ #{password,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="salt != null">
|
|
|
+ #{salt,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realname != null">
|
|
|
+ #{realname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="email != null">
|
|
|
+ #{email,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null">
|
|
|
+ #{mobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INT},
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null">
|
|
|
+ #{creatorId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ #{updaterId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="selectByUsername" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select <include refid="baseColumns"/> from ac_account where username=#{username}
|
|
|
+ </select>
|
|
|
+ <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select <include refid="baseColumns"/> from ac_account where mobile=#{mobile}
|
|
|
+ </select>
|
|
|
+ <select id="selectByEmail" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select <include refid="baseColumns"/> from ac_account where email=#{email}
|
|
|
+ </select>
|
|
|
+</mapper>
|