Authored by linlong

update

package com.yoho.unions.dal;
import com.yoho.unions.dal.model.Profile;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface IProfileDAO {
int deleteByPrimaryKey(Integer pid);
int insert(Profile record);
int insertSelective(Profile record);
Profile selectByPrimaryKey(Integer pid);
int updateByPrimaryKeySelective(Profile record);
int updateByPrimaryKey(Profile record);
/**
* 根据用户id列表批量获取用户信息
*/
List<Profile> batchSelectByPrimaryKey(@Param("list") List<Integer> pids);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
/**
* Created by yoho on 2017/2/16.
*/
public class Profile{
private static final long serialVersionUID = 6342804270613557444L;
/**
* 帐号记录ID
*/
private Integer pid;
/**
* 登录帐号
*/
private String account;
/**
* 真实姓名
*/
private String truename;
/**
* 员工号
*/
private String staffCode;
/**
* 邮件地址
*/
private String email;
/**
* 密码
*/
private String password;
/**
* 手机号
*/
private String phone;
/**
* 创建时间
*/
private Integer createTime;
/**
* 过期时间
*/
private Integer expires;
/**
* 登录时间
*/
private Integer loginTime;
/**
* 状态
*/
private Byte status;
/**
* 身份
* 1 => '品牌公司'
* 2 => '品牌经销商'
* 3 => '品牌代运营商'
* 4 => '有货品牌经理'
* 5 => '有货店铺运营'
* 6 => '有货商品运营'
* 7 => '有货平台运营'
*/
private Byte identity;
/**
* 认证站点
* 1 => '运营平台',
* 2 => '商家平台'
*
*/
private String authSite;
/**
* 角色ID
*/
private Integer roleId;
/**
* 部门ID
*/
private Integer deptId;
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account == null ? null : account.trim();
}
public String getTruename() {
return truename;
}
public void setTruename(String truename) {
this.truename = truename == null ? null : truename.trim();
}
public String getStaffCode() {
return staffCode;
}
public void setStaffCode(String staffCode) {
this.staffCode = staffCode == null ? null : staffCode.trim();
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getExpires() {
return expires;
}
public void setExpires(Integer expires) {
this.expires = expires;
}
public Integer getLoginTime() {
return loginTime;
}
public void setLoginTime(Integer loginTime) {
this.loginTime = loginTime;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public Byte getIdentity() {
return identity;
}
public void setIdentity(Byte identity) {
this.identity = identity;
}
public String getAuthSite() {
return authSite;
}
public void setAuthSite(String authSite) {
this.authSite = authSite == null ? null : authSite.trim();
}
public Integer getDeptId() {
return deptId;
}
public void setDeptId(Integer deptId) {
this.deptId = deptId;
}
}
\ No newline at end of file
... ...
<?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.yoho.unions.dal.IProfileDAO">
<resultMap id="BaseResultMap"
type="com.yoho.unions.dal.model.Profile">
<id column="pid" property="pid" jdbcType="INTEGER" />
<result column="account" property="account" jdbcType="VARCHAR" />
<result column="truename" property="truename" jdbcType="VARCHAR" />
<result column="staff_code" property="staffCode" jdbcType="VARCHAR" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="expires" property="expires" jdbcType="INTEGER" />
<result column="login_time" property="loginTime" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="identity" property="identity" jdbcType="TINYINT" />
<result column="auth_site" property="authSite" jdbcType="VARCHAR" />
<result column="role_id" property="roleId" jdbcType="INTEGER" />
<result column="dept_id" property="deptId" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
pid, account, truename, staff_code, email, password, phone, create_time,
expires,
login_time, status, identity, auth_site, role_id, dept_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from profile
where pid = #{pid,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from profile
where pid = #{pid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.Profile">
insert into profile (pid, account, truename,
staff_code, email, password,
phone, create_time, expires,
login_time, status, identity,
auth_site)
values (#{pid,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR},
#{truename,jdbcType=VARCHAR},
#{staffCode,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER},
#{expires,jdbcType=INTEGER},
#{loginTime,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, #{identity,jdbcType=TINYINT},
#{authSite,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.Profile">
insert into profile
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pid != null">
pid,
</if>
<if test="account != null">
account,
</if>
<if test="truename != null">
truename,
</if>
<if test="staffCode != null">
staff_code,
</if>
<if test="email != null">
email,
</if>
<if test="password != null">
password,
</if>
<if test="phone != null">
phone,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="expires != null">
expires,
</if>
<if test="loginTime != null">
login_time,
</if>
<if test="status != null">
status,
</if>
<if test="identity != null">
identity,
</if>
<if test="authSite != null">
auth_site,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pid != null">
#{pid,jdbcType=INTEGER},
</if>
<if test="account != null">
#{account,jdbcType=VARCHAR},
</if>
<if test="truename != null">
#{truename,jdbcType=VARCHAR},
</if>
<if test="staffCode != null">
#{staffCode,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
<if test="expires != null">
#{expires,jdbcType=INTEGER},
</if>
<if test="loginTime != null">
#{loginTime,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="identity != null">
#{identity,jdbcType=TINYINT},
</if>
<if test="authSite != null">
#{authSite,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.Profile">
update profile
<set>
<if test="account != null">
account = #{account,jdbcType=VARCHAR},
</if>
<if test="truename != null">
truename = #{truename,jdbcType=VARCHAR},
</if>
<if test="staffCode != null">
staff_code = #{staffCode,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="expires != null">
expires = #{expires,jdbcType=INTEGER},
</if>
<if test="loginTime != null">
login_time = #{loginTime,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
<if test="identity != null">
identity = #{identity,jdbcType=TINYINT},
</if>
<if test="authSite != null">
auth_site = #{authSite,jdbcType=VARCHAR},
</if>
</set>
where pid = #{pid,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.Profile">
update profile
set account = #{account,jdbcType=VARCHAR},
truename = #{truename,jdbcType=VARCHAR},
staff_code = #{staffCode,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER},
expires = #{expires,jdbcType=INTEGER},
login_time = #{loginTime,jdbcType=INTEGER},
status = #{status,jdbcType=TINYINT},
identity = #{identity,jdbcType=TINYINT},
auth_site = #{authSite,jdbcType=VARCHAR}
where pid = #{pid,jdbcType=INTEGER}
</update>
<select id="batchSelectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.util.List" >
select
<include refid="Base_Column_List" />
from profile
where pid in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
... ...