作者 朱兆平

spring security 切换到mysql 数据库

1 package com.tianbo.warehouse.dao; 1 package com.tianbo.warehouse.dao;
2 2
3 import com.tianbo.warehouse.model.PERMISSION; 3 import com.tianbo.warehouse.model.PERMISSION;
  4 +
4 import java.math.BigDecimal; 5 import java.math.BigDecimal;
5 import java.util.List; 6 import java.util.List;
6 7
7 public interface PERMISSIONMapper { 8 public interface PERMISSIONMapper {
8 - int deleteByPrimaryKey(BigDecimal permissionId); 9 + int deleteByPrimaryKey(Integer permissionId);
9 10
10 int insert(PERMISSION record); 11 int insert(PERMISSION record);
11 12
12 int insertSelective(PERMISSION record); 13 int insertSelective(PERMISSION record);
13 14
14 - List<PERMISSION> selectByPrimaryKey(BigDecimal permissionId); 15 + PERMISSION selectByPrimaryKey(Integer permissionId);
15 16
16 int updateByPrimaryKeySelective(PERMISSION record); 17 int updateByPrimaryKeySelective(PERMISSION record);
17 18
@@ -19,5 +20,5 @@ public interface PERMISSIONMapper { @@ -19,5 +20,5 @@ public interface PERMISSIONMapper {
19 20
20 List<PERMISSION> findAll(); 21 List<PERMISSION> findAll();
21 22
22 - List<PERMISSION> findByUserId(BigDecimal userId); 23 + List<PERMISSION> findByUserId(Integer userId);
23 } 24 }
1 package com.tianbo.warehouse.dao; 1 package com.tianbo.warehouse.dao;
2 2
3 import com.tianbo.warehouse.model.ROLE; 3 import com.tianbo.warehouse.model.ROLE;
  4 +
4 import java.math.BigDecimal; 5 import java.math.BigDecimal;
5 import java.util.List; 6 import java.util.List;
6 7
7 public interface ROLEMapper { 8 public interface ROLEMapper {
8 - int deleteByPrimaryKey(BigDecimal roleId); 9 + int deleteByPrimaryKey(Integer roleId);
9 10
10 int insert(ROLE record); 11 int insert(ROLE record);
11 12
12 int insertSelective(ROLE record); 13 int insertSelective(ROLE record);
13 14
14 - ROLE selectByPrimaryKey(BigDecimal roleId); 15 + ROLE selectByPrimaryKey(Integer roleId);
15 16
16 int updateByPrimaryKeySelective(ROLE record); 17 int updateByPrimaryKeySelective(ROLE record);
17 18
18 int updateByPrimaryKey(ROLE record); 19 int updateByPrimaryKey(ROLE record);
19 20
20 - List<ROLE> findRolesByUserId(BigDecimal userId); 21 + List<ROLE> findRolesByUserId(Integer userId);
21 } 22 }
1 package com.tianbo.warehouse.dao; 1 package com.tianbo.warehouse.dao;
2 2
3 -import com.tianbo.warehouse.model.ROLE;  
4 import com.tianbo.warehouse.model.USERS; 3 import com.tianbo.warehouse.model.USERS;
5 -import java.math.BigDecimal; 4 +
6 import java.util.List; 5 import java.util.List;
7 6
8 public interface USERSMapper { 7 public interface USERSMapper {
9 - int deleteByPrimaryKey(BigDecimal userId); 8 + int deleteByPrimaryKey(Integer userId);
10 9
11 int insert(USERS record); 10 int insert(USERS record);
12 11
13 int insertSelective(USERS record); 12 int insertSelective(USERS record);
14 13
15 - USERS selectByPrimaryKey(BigDecimal userId);  
16 -  
17 - List<USERS> selectByUsername(String userName); 14 + USERS selectByPrimaryKey(Integer userId);
18 15
19 int updateByPrimaryKeySelective(USERS record); 16 int updateByPrimaryKeySelective(USERS record);
20 17
21 int updateByPrimaryKey(USERS record); 18 int updateByPrimaryKey(USERS record);
22 19
23 - List<USERS> selectAllUser(); 20 + List<USERS> selectByUsername(String userName);
24 21
  22 + List<USERS> selectAllUser();
25 } 23 }
@@ -2,13 +2,10 @@ package com.tianbo.warehouse.model; @@ -2,13 +2,10 @@ package com.tianbo.warehouse.model;
2 2
3 import org.springframework.security.core.GrantedAuthority; 3 import org.springframework.security.core.GrantedAuthority;
4 4
5 -import java.math.BigDecimal; 5 +public class PERMISSION implements GrantedAuthority {
  6 + private static final long serialVersionUID = -3957539165716897100L;
6 7
7 -public class PERMISSION implements GrantedAuthority{  
8 -  
9 - private static final long serialVersionUID = -3957539165716897200L;  
10 -  
11 - private BigDecimal permissionId; 8 + private Integer permissionId;
12 9
13 private String permissionName; 10 private String permissionName;
14 11
@@ -18,11 +15,23 @@ public class PERMISSION implements GrantedAuthority{ @@ -18,11 +15,23 @@ public class PERMISSION implements GrantedAuthority{
18 15
19 private String groupName; 16 private String groupName;
20 17
21 - public BigDecimal getPermissionId() { 18 + private Integer parentId;
  19 +
  20 + private String path;
  21 +
  22 + private String url;
  23 +
  24 + private String ext1;
  25 +
  26 + private String ext2;
  27 +
  28 + private String ext3;
  29 +
  30 + public Integer getPermissionId() {
22 return permissionId; 31 return permissionId;
23 } 32 }
24 33
25 - public void setPermissionId(BigDecimal permissionId) { 34 + public void setPermissionId(Integer permissionId) {
26 this.permissionId = permissionId; 35 this.permissionId = permissionId;
27 } 36 }
28 37
@@ -58,6 +67,54 @@ public class PERMISSION implements GrantedAuthority{ @@ -58,6 +67,54 @@ public class PERMISSION implements GrantedAuthority{
58 this.groupName = groupName == null ? null : groupName.trim(); 67 this.groupName = groupName == null ? null : groupName.trim();
59 } 68 }
60 69
  70 + public Integer getParentId() {
  71 + return parentId;
  72 + }
  73 +
  74 + public void setParentId(Integer parentId) {
  75 + this.parentId = parentId;
  76 + }
  77 +
  78 + public String getPath() {
  79 + return path;
  80 + }
  81 +
  82 + public void setPath(String path) {
  83 + this.path = path == null ? null : path.trim();
  84 + }
  85 +
  86 + public String getUrl() {
  87 + return url;
  88 + }
  89 +
  90 + public void setUrl(String url) {
  91 + this.url = url == null ? null : url.trim();
  92 + }
  93 +
  94 + public String getExt1() {
  95 + return ext1;
  96 + }
  97 +
  98 + public void setExt1(String ext1) {
  99 + this.ext1 = ext1 == null ? null : ext1.trim();
  100 + }
  101 +
  102 + public String getExt2() {
  103 + return ext2;
  104 + }
  105 +
  106 + public void setExt2(String ext2) {
  107 + this.ext2 = ext2 == null ? null : ext2.trim();
  108 + }
  109 +
  110 + public String getExt3() {
  111 + return ext3;
  112 + }
  113 +
  114 + public void setExt3(String ext3) {
  115 + this.ext3 = ext3 == null ? null : ext3.trim();
  116 + }
  117 +
61 @Override 118 @Override
62 public String getAuthority(){ 119 public String getAuthority(){
63 return this.getPermissionName(); 120 return this.getPermissionName();
1 package com.tianbo.warehouse.model; 1 package com.tianbo.warehouse.model;
2 2
3 -import org.springframework.security.core.GrantedAuthority;  
4 -  
5 -import java.math.BigDecimal;  
6 -  
7 -public class ROLE{  
8 -  
9 -  
10 -  
11 - private BigDecimal roleId; 3 +public class ROLE {
  4 + private Integer roleId;
12 5
13 private String roleName; 6 private String roleName;
14 7
@@ -16,11 +9,11 @@ public class ROLE{ @@ -16,11 +9,11 @@ public class ROLE{
16 9
17 private String description; 10 private String description;
18 11
19 - public BigDecimal getRoleId() { 12 + public Integer getRoleId() {
20 return roleId; 13 return roleId;
21 } 14 }
22 15
23 - public void setRoleId(BigDecimal roleId) { 16 + public void setRoleId(Integer roleId) {
24 this.roleId = roleId; 17 this.roleId = roleId;
25 } 18 }
26 19
@@ -47,6 +40,4 @@ public class ROLE{ @@ -47,6 +40,4 @@ public class ROLE{
47 public void setDescription(String description) { 40 public void setDescription(String description) {
48 this.description = description == null ? null : description.trim(); 41 this.description = description == null ? null : description.trim();
49 } 42 }
50 -  
51 -  
52 } 43 }
@@ -4,46 +4,49 @@ import org.springframework.security.core.GrantedAuthority; @@ -4,46 +4,49 @@ import org.springframework.security.core.GrantedAuthority;
4 import org.springframework.security.core.authority.SimpleGrantedAuthority; 4 import org.springframework.security.core.authority.SimpleGrantedAuthority;
5 import org.springframework.security.core.userdetails.UserDetails; 5 import org.springframework.security.core.userdetails.UserDetails;
6 6
7 -import java.io.Serializable;  
8 -import java.math.BigDecimal;  
9 import java.util.ArrayList; 7 import java.util.ArrayList;
10 import java.util.Collection; 8 import java.util.Collection;
11 import java.util.Date; 9 import java.util.Date;
12 import java.util.List; 10 import java.util.List;
13 11
14 -public class USERS implements UserDetails{  
15 -  
16 - private static final long serialVersionUID = 1L;  
17 -  
18 - private BigDecimal userId; 12 +public class USERS implements UserDetails {
  13 + private Integer userId;
19 14
20 private String username; 15 private String username;
21 16
22 private String password; 17 private String password;
23 18
24 - private Short state;  
25 -  
26 - private Date creattime; 19 + private Date birthday;
27 20
28 private String sex; 21 private String sex;
29 22
30 private String address; 23 private String address;
31 24
32 - private Date birthday; 25 + private Boolean state;
33 26
34 private String mobilephone; 27 private String mobilephone;
35 28
  29 + private Date creattime;
  30 +
36 private Date updatetime; 31 private Date updatetime;
37 32
  33 + private String userface;
  34 +
  35 + private String ext1;
  36 +
  37 + private String ext2;
  38 +
  39 + private String ext3;
  40 +
38 private List<ROLE> roles; 41 private List<ROLE> roles;
39 42
40 private List<PERMISSION> permissions; 43 private List<PERMISSION> permissions;
41 44
42 - public BigDecimal getUserId() { 45 + public Integer getUserId() {
43 return userId; 46 return userId;
44 } 47 }
45 48
46 - public void setUserId(BigDecimal userId) { 49 + public void setUserId(Integer userId) {
47 this.userId = userId; 50 this.userId = userId;
48 } 51 }
49 52
@@ -65,20 +68,12 @@ public class USERS implements UserDetails{ @@ -65,20 +68,12 @@ public class USERS implements UserDetails{
65 this.password = password == null ? null : password.trim(); 68 this.password = password == null ? null : password.trim();
66 } 69 }
67 70
68 - public Short getState() {  
69 - return state;  
70 - }  
71 -  
72 - public void setState(Short state) {  
73 - this.state = state;  
74 - }  
75 -  
76 - public Date getCreattime() {  
77 - return creattime; 71 + public Date getBirthday() {
  72 + return birthday;
78 } 73 }
79 74
80 - public void setCreattime(Date creattime) {  
81 - this.creattime = creattime; 75 + public void setBirthday(Date birthday) {
  76 + this.birthday = birthday;
82 } 77 }
83 78
84 public String getSex() { 79 public String getSex() {
@@ -97,12 +92,12 @@ public class USERS implements UserDetails{ @@ -97,12 +92,12 @@ public class USERS implements UserDetails{
97 this.address = address == null ? null : address.trim(); 92 this.address = address == null ? null : address.trim();
98 } 93 }
99 94
100 - public Date getBirthday() {  
101 - return birthday; 95 + public Boolean getState() {
  96 + return state;
102 } 97 }
103 98
104 - public void setBirthday(Date birthday) {  
105 - this.birthday = birthday; 99 + public void setState(Boolean state) {
  100 + this.state = state;
106 } 101 }
107 102
108 public String getMobilephone() { 103 public String getMobilephone() {
@@ -113,6 +108,14 @@ public class USERS implements UserDetails{ @@ -113,6 +108,14 @@ public class USERS implements UserDetails{
113 this.mobilephone = mobilephone == null ? null : mobilephone.trim(); 108 this.mobilephone = mobilephone == null ? null : mobilephone.trim();
114 } 109 }
115 110
  111 + public Date getCreattime() {
  112 + return creattime;
  113 + }
  114 +
  115 + public void setCreattime(Date creattime) {
  116 + this.creattime = creattime;
  117 + }
  118 +
116 public Date getUpdatetime() { 119 public Date getUpdatetime() {
117 return updatetime; 120 return updatetime;
118 } 121 }
@@ -121,6 +124,38 @@ public class USERS implements UserDetails{ @@ -121,6 +124,38 @@ public class USERS implements UserDetails{
121 this.updatetime = updatetime; 124 this.updatetime = updatetime;
122 } 125 }
123 126
  127 + public String getUserface() {
  128 + return userface;
  129 + }
  130 +
  131 + public void setUserface(String userface) {
  132 + this.userface = userface == null ? null : userface.trim();
  133 + }
  134 +
  135 + public String getExt1() {
  136 + return ext1;
  137 + }
  138 +
  139 + public void setExt1(String ext1) {
  140 + this.ext1 = ext1 == null ? null : ext1.trim();
  141 + }
  142 +
  143 + public String getExt2() {
  144 + return ext2;
  145 + }
  146 +
  147 + public void setExt2(String ext2) {
  148 + this.ext2 = ext2 == null ? null : ext2.trim();
  149 + }
  150 +
  151 + public String getExt3() {
  152 + return ext3;
  153 + }
  154 +
  155 + public void setExt3(String ext3) {
  156 + this.ext3 = ext3 == null ? null : ext3.trim();
  157 + }
  158 +
124 public List<ROLE> getRoles() { 159 public List<ROLE> getRoles() {
125 return roles; 160 return roles;
126 } 161 }
@@ -179,7 +214,7 @@ public class USERS implements UserDetails{ @@ -179,7 +214,7 @@ public class USERS implements UserDetails{
179 */ 214 */
180 @Override 215 @Override
181 public Collection<? extends GrantedAuthority> getAuthorities(){ 216 public Collection<? extends GrantedAuthority> getAuthorities(){
182 - List<GrantedAuthority> auths = new ArrayList<GrantedAuthority>(); 217 + List<GrantedAuthority> auths = new ArrayList<>();
183 List<PERMISSION> permissions = this.getPermissions(); 218 List<PERMISSION> permissions = this.getPermissions();
184 for (PERMISSION permission : permissions) { 219 for (PERMISSION permission : permissions) {
185 auths.add(new SimpleGrantedAuthority(permission.getAuthority())); 220 auths.add(new SimpleGrantedAuthority(permission.getAuthority()));
@@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> 4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5 <generatorConfiguration> 5 <generatorConfiguration>
6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> 6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
7 - <!--<classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>-->  
8 - <classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/> 7 + <classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>
  8 + <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>-->
9 <context id="DB2Tables" targetRuntime="MyBatis3"> 9 <context id="DB2Tables" targetRuntime="MyBatis3">
10 <commentGenerator> 10 <commentGenerator>
11 <property name="suppressDate" value="true"/> 11 <property name="suppressDate" value="true"/>
@@ -13,13 +13,16 @@ @@ -13,13 +13,16 @@
13 <property name="suppressAllComments" value="true"/> 13 <property name="suppressAllComments" value="true"/>
14 </commentGenerator> 14 </commentGenerator>
15 <!--数据库链接URL,用户名、密码 --> 15 <!--数据库链接URL,用户名、密码 -->
16 - <!--<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3307/statistics" userId="root" password="">-->  
17 - <!--</jdbcConnection>-->  
18 - <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"  
19 - connectionURL="jdbc:oracle:thin:@10.50.3.68:1521:CGODW"  
20 - userId="CGOETL"  
21 - password="1q2w3e4r"> 16 + <jdbcConnection driverClass="com.mysql.jdbc.Driver"
  17 + connectionURL="jdbc:mysql://127.0.0.1:3307/statistics"
  18 + userId="root"
  19 + password="">
22 </jdbcConnection> 20 </jdbcConnection>
  21 + <!--<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"-->
  22 + <!--connectionURL="jdbc:oracle:thin:@10.50.3.68:1521:CGODW"-->
  23 + <!--userId="CGOETL"-->
  24 + <!--password="1q2w3e4r">-->
  25 + <!--</jdbcConnection>-->
23 <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和 26 <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
24 NUMERIC 类型解析为java.math.BigDecimal --> 27 NUMERIC 类型解析为java.math.BigDecimal -->
25 <!--<javaTypeResolver>--> 28 <!--<javaTypeResolver>-->
@@ -42,6 +45,6 @@ @@ -42,6 +45,6 @@
42 <property name="enableSubPackages" value="true"/> 45 <property name="enableSubPackages" value="true"/>
43 </javaClientGenerator> 46 </javaClientGenerator>
44 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
45 - <table tableName="PERMISSION" domainObjectName="PERMISSION" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 48 + <table tableName="permission" domainObjectName="PERMISSION" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
46 </context> 49 </context>
47 </generatorConfiguration> 50 </generatorConfiguration>
@@ -2,88 +2,116 @@ @@ -2,88 +2,116 @@
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.tianbo.warehouse.dao.PERMISSIONMapper" > 3 <mapper namespace="com.tianbo.warehouse.dao.PERMISSIONMapper" >
4 <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.PERMISSION" > 4 <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.PERMISSION" >
5 - <id column="PERMISSION_ID" property="permissionId" jdbcType="DECIMAL" />  
6 - <result column="PERMISSION_NAME" property="permissionName" jdbcType="VARCHAR" />  
7 - <result column="PERMISSION_SIGN" property="permissionSign" jdbcType="VARCHAR" />  
8 - <result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />  
9 - <result column="GROUP_NAME" property="groupName" jdbcType="VARCHAR" /> 5 + <id column="permission_id" property="permissionId" jdbcType="INTEGER" />
  6 + <result column="permission_name" property="permissionName" jdbcType="VARCHAR" />
  7 + <result column="permission_sign" property="permissionSign" jdbcType="VARCHAR" />
  8 + <result column="description" property="description" jdbcType="VARCHAR" />
  9 + <result column="group_name" property="groupName" jdbcType="VARCHAR" />
  10 + <result column="parent_id" property="parentId" jdbcType="INTEGER" />
  11 + <result column="path" property="path" jdbcType="VARCHAR" />
  12 + <result column="url" property="url" jdbcType="VARCHAR" />
  13 + <result column="ext1" property="ext1" jdbcType="VARCHAR" />
  14 + <result column="ext2" property="ext2" jdbcType="VARCHAR" />
  15 + <result column="ext3" property="ext3" jdbcType="VARCHAR" />
10 </resultMap> 16 </resultMap>
11 <sql id="Base_Column_List" > 17 <sql id="Base_Column_List" >
12 - PERMISSION_ID, PERMISSION_NAME, PERMISSION_SIGN, DESCRIPTION, GROUP_NAME 18 + permission_id, permission_name, permission_sign, description, group_name, parent_id,
  19 + path, url, ext1, ext2, ext3
13 </sql> 20 </sql>
14 - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.math.BigDecimal" > 21 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
15 select 22 select
16 <include refid="Base_Column_List" /> 23 <include refid="Base_Column_List" />
17 - from PERMISSION  
18 - where PERMISSION_ID = #{permissionId,jdbcType=DECIMAL} 24 + from permission
  25 + where permission_id = #{permissionId,jdbcType=INTEGER}
19 </select> 26 </select>
20 <select id="findAll" resultMap="BaseResultMap" > 27 <select id="findAll" resultMap="BaseResultMap" >
21 select 28 select
22 <include refid="Base_Column_List" /> 29 <include refid="Base_Column_List" />
23 - from PERMISSION 30 + from permission
24 </select> 31 </select>
25 - <select id="findByUserId" parameterType="java.math.BigDecimal" resultMap="BaseResultMap"> 32 + <select id="findByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
26 SELECT 33 SELECT
27 - P .*  
28 -FROM  
29 - PERMISSION P  
30 -WHERE  
31 - P .PERMISSION_ID IN (  
32 - SELECT  
33 - RP.permission_id  
34 - FROM  
35 - ROLE_PERMISSION RP  
36 - WHERE  
37 - RP.role_id IN (  
38 - SELECT  
39 - R.ROLE_ID  
40 - FROM  
41 - ROLE R  
42 - WHERE  
43 - R.ROLE_ID IN (  
44 - SELECT  
45 - UR.ROLE_ID  
46 - FROM  
47 - USER_ROLE UR  
48 - WHERE  
49 - UR.USER_ID = #{userId,jdbcType=DECIMAL}  
50 - )  
51 - )  
52 - ) 34 + P .*
  35 + FROM
  36 + permission P
  37 + WHERE
  38 + P .PERMISSION_ID IN (
  39 + SELECT
  40 + RP.permission_id
  41 + FROM
  42 + ROLE_PERMISSION RP
  43 + WHERE
  44 + RP.role_id IN (
  45 + SELECT
  46 + R.ROLE_ID
  47 + FROM
  48 + role R
  49 + WHERE
  50 + R.ROLE_ID IN (
  51 + SELECT
  52 + UR.ROLE_ID
  53 + FROM
  54 + USER_ROLE UR
  55 + WHERE
  56 + UR.USER_ID = #{userId,jdbcType=INTEGER}
  57 + )
  58 + )
  59 + )
53 </select> 60 </select>
54 -  
55 - <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal" >  
56 - delete from PERMISSION  
57 - where PERMISSION_ID = #{permissionId,jdbcType=DECIMAL} 61 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  62 + delete from permission
  63 + where permission_id = #{permissionId,jdbcType=INTEGER}
58 </delete> 64 </delete>
59 <insert id="insert" parameterType="com.tianbo.warehouse.model.PERMISSION" > 65 <insert id="insert" parameterType="com.tianbo.warehouse.model.PERMISSION" >
60 - insert into PERMISSION (PERMISSION_ID, PERMISSION_NAME, PERMISSION_SIGN,  
61 - DESCRIPTION, GROUP_NAME)  
62 - values (#{permissionId,jdbcType=DECIMAL}, #{permissionName,jdbcType=VARCHAR}, #{permissionSign,jdbcType=VARCHAR},  
63 - #{description,jdbcType=VARCHAR}, #{groupName,jdbcType=VARCHAR}) 66 + insert into permission (permission_id, permission_name, permission_sign,
  67 + description, group_name, parent_id,
  68 + path, url, ext1, ext2,
  69 + ext3)
  70 + values (#{permissionId,jdbcType=INTEGER}, #{permissionName,jdbcType=VARCHAR}, #{permissionSign,jdbcType=VARCHAR},
  71 + #{description,jdbcType=VARCHAR}, #{groupName,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
  72 + #{path,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR},
  73 + #{ext3,jdbcType=VARCHAR})
64 </insert> 74 </insert>
65 <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.PERMISSION" > 75 <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.PERMISSION" >
66 - insert into PERMISSION 76 + insert into permission
67 <trim prefix="(" suffix=")" suffixOverrides="," > 77 <trim prefix="(" suffix=")" suffixOverrides="," >
68 <if test="permissionId != null" > 78 <if test="permissionId != null" >
69 - PERMISSION_ID, 79 + permission_id,
70 </if> 80 </if>
71 <if test="permissionName != null" > 81 <if test="permissionName != null" >
72 - PERMISSION_NAME, 82 + permission_name,
73 </if> 83 </if>
74 <if test="permissionSign != null" > 84 <if test="permissionSign != null" >
75 - PERMISSION_SIGN, 85 + permission_sign,
76 </if> 86 </if>
77 <if test="description != null" > 87 <if test="description != null" >
78 - DESCRIPTION, 88 + description,
79 </if> 89 </if>
80 <if test="groupName != null" > 90 <if test="groupName != null" >
81 - GROUP_NAME, 91 + group_name,
  92 + </if>
  93 + <if test="parentId != null" >
  94 + parent_id,
  95 + </if>
  96 + <if test="path != null" >
  97 + path,
  98 + </if>
  99 + <if test="url != null" >
  100 + url,
  101 + </if>
  102 + <if test="ext1 != null" >
  103 + ext1,
  104 + </if>
  105 + <if test="ext2 != null" >
  106 + ext2,
  107 + </if>
  108 + <if test="ext3 != null" >
  109 + ext3,
82 </if> 110 </if>
83 </trim> 111 </trim>
84 <trim prefix="values (" suffix=")" suffixOverrides="," > 112 <trim prefix="values (" suffix=")" suffixOverrides="," >
85 <if test="permissionId != null" > 113 <if test="permissionId != null" >
86 - #{permissionId,jdbcType=DECIMAL}, 114 + #{permissionId,jdbcType=INTEGER},
87 </if> 115 </if>
88 <if test="permissionName != null" > 116 <if test="permissionName != null" >
89 #{permissionName,jdbcType=VARCHAR}, 117 #{permissionName,jdbcType=VARCHAR},
@@ -97,32 +125,74 @@ WHERE @@ -97,32 +125,74 @@ WHERE
97 <if test="groupName != null" > 125 <if test="groupName != null" >
98 #{groupName,jdbcType=VARCHAR}, 126 #{groupName,jdbcType=VARCHAR},
99 </if> 127 </if>
  128 + <if test="parentId != null" >
  129 + #{parentId,jdbcType=INTEGER},
  130 + </if>
  131 + <if test="path != null" >
  132 + #{path,jdbcType=VARCHAR},
  133 + </if>
  134 + <if test="url != null" >
  135 + #{url,jdbcType=VARCHAR},
  136 + </if>
  137 + <if test="ext1 != null" >
  138 + #{ext1,jdbcType=VARCHAR},
  139 + </if>
  140 + <if test="ext2 != null" >
  141 + #{ext2,jdbcType=VARCHAR},
  142 + </if>
  143 + <if test="ext3 != null" >
  144 + #{ext3,jdbcType=VARCHAR},
  145 + </if>
100 </trim> 146 </trim>
101 </insert> 147 </insert>
102 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.PERMISSION" > 148 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.PERMISSION" >
103 - update PERMISSION 149 + update permission
104 <set > 150 <set >
105 <if test="permissionName != null" > 151 <if test="permissionName != null" >
106 - PERMISSION_NAME = #{permissionName,jdbcType=VARCHAR}, 152 + permission_name = #{permissionName,jdbcType=VARCHAR},
107 </if> 153 </if>
108 <if test="permissionSign != null" > 154 <if test="permissionSign != null" >
109 - PERMISSION_SIGN = #{permissionSign,jdbcType=VARCHAR}, 155 + permission_sign = #{permissionSign,jdbcType=VARCHAR},
110 </if> 156 </if>
111 <if test="description != null" > 157 <if test="description != null" >
112 - DESCRIPTION = #{description,jdbcType=VARCHAR}, 158 + description = #{description,jdbcType=VARCHAR},
113 </if> 159 </if>
114 <if test="groupName != null" > 160 <if test="groupName != null" >
115 - GROUP_NAME = #{groupName,jdbcType=VARCHAR}, 161 + group_name = #{groupName,jdbcType=VARCHAR},
  162 + </if>
  163 + <if test="parentId != null" >
  164 + parent_id = #{parentId,jdbcType=INTEGER},
  165 + </if>
  166 + <if test="path != null" >
  167 + path = #{path,jdbcType=VARCHAR},
  168 + </if>
  169 + <if test="url != null" >
  170 + url = #{url,jdbcType=VARCHAR},
  171 + </if>
  172 + <if test="ext1 != null" >
  173 + ext1 = #{ext1,jdbcType=VARCHAR},
  174 + </if>
  175 + <if test="ext2 != null" >
  176 + ext2 = #{ext2,jdbcType=VARCHAR},
  177 + </if>
  178 + <if test="ext3 != null" >
  179 + ext3 = #{ext3,jdbcType=VARCHAR},
116 </if> 180 </if>
117 </set> 181 </set>
118 - where PERMISSION_ID = #{permissionId,jdbcType=DECIMAL} 182 + where permission_id = #{permissionId,jdbcType=INTEGER}
119 </update> 183 </update>
120 <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.PERMISSION" > 184 <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.PERMISSION" >
121 - update PERMISSION  
122 - set PERMISSION_NAME = #{permissionName,jdbcType=VARCHAR},  
123 - PERMISSION_SIGN = #{permissionSign,jdbcType=VARCHAR},  
124 - DESCRIPTION = #{description,jdbcType=VARCHAR},  
125 - GROUP_NAME = #{groupName,jdbcType=VARCHAR}  
126 - where PERMISSION_ID = #{permissionId,jdbcType=DECIMAL} 185 + update permission
  186 + set permission_name = #{permissionName,jdbcType=VARCHAR},
  187 + permission_sign = #{permissionSign,jdbcType=VARCHAR},
  188 + description = #{description,jdbcType=VARCHAR},
  189 + group_name = #{groupName,jdbcType=VARCHAR},
  190 + parent_id = #{parentId,jdbcType=INTEGER},
  191 + path = #{path,jdbcType=VARCHAR},
  192 + url = #{url,jdbcType=VARCHAR},
  193 + ext1 = #{ext1,jdbcType=VARCHAR},
  194 + ext2 = #{ext2,jdbcType=VARCHAR},
  195 + ext3 = #{ext3,jdbcType=VARCHAR}
  196 + where permission_id = #{permissionId,jdbcType=INTEGER}
127 </update> 197 </update>
128 </mapper> 198 </mapper>
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >  
3 -<mapper namespace="com.tianbo.warehouse.dao.ROLEMapper" >  
4 - <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.ROLE" >  
5 - <id column="ROLE_ID" property="roleId" jdbcType="DECIMAL" />  
6 - <result column="ROLE_NAME" property="roleName" jdbcType="VARCHAR" />  
7 - <result column="ROLE_SIGN" property="roleSign" jdbcType="VARCHAR" />  
8 - <result column="DESCRIPTION" property="description" jdbcType="VARCHAR" /> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.tianbo.warehouse.dao.ROLEMapper">
  4 + <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.ROLE">
  5 + <id column="role_id" jdbcType="INTEGER" property="roleId" />
  6 + <result column="role_name" jdbcType="VARCHAR" property="roleName" />
  7 + <result column="role_sign" jdbcType="VARCHAR" property="roleSign" />
  8 + <result column="description" jdbcType="VARCHAR" property="description" />
9 </resultMap> 9 </resultMap>
10 - <sql id="Base_Column_List" >  
11 - ROLE_ID, ROLE_NAME, ROLE_SIGN, DESCRIPTION 10 + <sql id="Base_Column_List">
  11 + role_id, role_name, role_sign, description
12 </sql> 12 </sql>
13 - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.math.BigDecimal" > 13 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
14 select 14 select
15 <include refid="Base_Column_List" /> 15 <include refid="Base_Column_List" />
16 - from ROLE  
17 - where ROLE_ID = #{roleId,jdbcType=DECIMAL} 16 + from role
  17 + where role_id = #{roleId,jdbcType=INTEGER}
18 </select> 18 </select>
19 - <select id="findRolesByUserId" parameterType="java.math.BigDecimal" resultMap="BaseResultMap"> 19 + <select id="findRolesByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
20 SELECT 20 SELECT
21 R.* 21 R.*
22 FROM 22 FROM
23 USERS U 23 USERS U
24 LEFT JOIN USER_ROLE UR ON U .USER_ID = UR.USER_ID 24 LEFT JOIN USER_ROLE UR ON U .USER_ID = UR.USER_ID
25 LEFT JOIN ROLE R ON R.ROLE_ID= UR.ROLE_ID 25 LEFT JOIN ROLE R ON R.ROLE_ID= UR.ROLE_ID
26 - where U.USER_ID = #{userId,jdbcType=DECIMAL} 26 + where U.USER_ID = #{userId,jdbcType=INTEGER}
27 </select> 27 </select>
28 - <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal" >  
29 - delete from ROLE  
30 - where ROLE_ID = #{roleId,jdbcType=DECIMAL} 28 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  29 + delete from role
  30 + where role_id = #{roleId,jdbcType=INTEGER}
31 </delete> 31 </delete>
32 - <insert id="insert" parameterType="com.tianbo.warehouse.model.ROLE" >  
33 - insert into ROLE (ROLE_ID, ROLE_NAME, ROLE_SIGN,  
34 - DESCRIPTION)  
35 - values (#{roleId,jdbcType=DECIMAL}, #{roleName,jdbcType=VARCHAR}, #{roleSign,jdbcType=VARCHAR}, 32 + <insert id="insert" parameterType="com.tianbo.warehouse.model.ROLE">
  33 + insert into role (role_id, role_name, role_sign,
  34 + description)
  35 + values (#{roleId,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{roleSign,jdbcType=VARCHAR},
36 #{description,jdbcType=VARCHAR}) 36 #{description,jdbcType=VARCHAR})
37 </insert> 37 </insert>
38 - <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.ROLE" >  
39 - insert into ROLE  
40 - <trim prefix="(" suffix=")" suffixOverrides="," >  
41 - <if test="roleId != null" >  
42 - ROLE_ID, 38 + <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.ROLE">
  39 + insert into role
  40 + <trim prefix="(" suffix=")" suffixOverrides=",">
  41 + <if test="roleId != null">
  42 + role_id,
43 </if> 43 </if>
44 - <if test="roleName != null" >  
45 - ROLE_NAME, 44 + <if test="roleName != null">
  45 + role_name,
46 </if> 46 </if>
47 - <if test="roleSign != null" >  
48 - ROLE_SIGN, 47 + <if test="roleSign != null">
  48 + role_sign,
49 </if> 49 </if>
50 - <if test="description != null" >  
51 - DESCRIPTION, 50 + <if test="description != null">
  51 + description,
52 </if> 52 </if>
53 </trim> 53 </trim>
54 - <trim prefix="values (" suffix=")" suffixOverrides="," >  
55 - <if test="roleId != null" >  
56 - #{roleId,jdbcType=DECIMAL}, 54 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  55 + <if test="roleId != null">
  56 + #{roleId,jdbcType=INTEGER},
57 </if> 57 </if>
58 - <if test="roleName != null" > 58 + <if test="roleName != null">
59 #{roleName,jdbcType=VARCHAR}, 59 #{roleName,jdbcType=VARCHAR},
60 </if> 60 </if>
61 - <if test="roleSign != null" > 61 + <if test="roleSign != null">
62 #{roleSign,jdbcType=VARCHAR}, 62 #{roleSign,jdbcType=VARCHAR},
63 </if> 63 </if>
64 - <if test="description != null" > 64 + <if test="description != null">
65 #{description,jdbcType=VARCHAR}, 65 #{description,jdbcType=VARCHAR},
66 </if> 66 </if>
67 </trim> 67 </trim>
68 </insert> 68 </insert>
69 - <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.ROLE" >  
70 - update ROLE  
71 - <set >  
72 - <if test="roleName != null" >  
73 - ROLE_NAME = #{roleName,jdbcType=VARCHAR}, 69 + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.ROLE">
  70 + update role
  71 + <set>
  72 + <if test="roleName != null">
  73 + role_name = #{roleName,jdbcType=VARCHAR},
74 </if> 74 </if>
75 - <if test="roleSign != null" >  
76 - ROLE_SIGN = #{roleSign,jdbcType=VARCHAR}, 75 + <if test="roleSign != null">
  76 + role_sign = #{roleSign,jdbcType=VARCHAR},
77 </if> 77 </if>
78 - <if test="description != null" >  
79 - DESCRIPTION = #{description,jdbcType=VARCHAR}, 78 + <if test="description != null">
  79 + description = #{description,jdbcType=VARCHAR},
80 </if> 80 </if>
81 </set> 81 </set>
82 - where ROLE_ID = #{roleId,jdbcType=DECIMAL} 82 + where role_id = #{roleId,jdbcType=INTEGER}
83 </update> 83 </update>
84 - <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.ROLE" >  
85 - update ROLE  
86 - set ROLE_NAME = #{roleName,jdbcType=VARCHAR},  
87 - ROLE_SIGN = #{roleSign,jdbcType=VARCHAR},  
88 - DESCRIPTION = #{description,jdbcType=VARCHAR}  
89 - where ROLE_ID = #{roleId,jdbcType=DECIMAL} 84 + <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.ROLE">
  85 + update role
  86 + set role_name = #{roleName,jdbcType=VARCHAR},
  87 + role_sign = #{roleSign,jdbcType=VARCHAR},
  88 + description = #{description,jdbcType=VARCHAR}
  89 + where role_id = #{roleId,jdbcType=INTEGER}
90 </update> 90 </update>
91 </mapper> 91 </mapper>
@@ -2,89 +2,107 @@ @@ -2,89 +2,107 @@
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.tianbo.warehouse.dao.USERSMapper" > 3 <mapper namespace="com.tianbo.warehouse.dao.USERSMapper" >
4 <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.USERS" > 4 <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.USERS" >
5 - <id column="USER_ID" property="userId" jdbcType="DECIMAL" />  
6 - <result column="USERNAME" property="username" jdbcType="VARCHAR" />  
7 - <result column="PASSWORD" property="password" jdbcType="VARCHAR" />  
8 - <result column="STATE" property="state" jdbcType="DECIMAL" />  
9 - <result column="CREATTIME" property="creattime" jdbcType="TIMESTAMP" />  
10 - <result column="SEX" property="sex" jdbcType="VARCHAR" />  
11 - <result column="ADDRESS" property="address" jdbcType="VARCHAR" />  
12 - <result column="BIRTHDAY" property="birthday" jdbcType="TIMESTAMP" />  
13 - <result column="MOBILEPHONE" property="mobilephone" jdbcType="VARCHAR" />  
14 - <result column="UPDATETIME" property="updatetime" jdbcType="TIMESTAMP" /> 5 + <id column="user_id" property="userId" jdbcType="INTEGER" />
  6 + <result column="username" property="username" jdbcType="VARCHAR" />
  7 + <result column="password" property="password" jdbcType="VARCHAR" />
  8 + <result column="birthday" property="birthday" jdbcType="TIMESTAMP" />
  9 + <result column="sex" property="sex" jdbcType="CHAR" />
  10 + <result column="address" property="address" jdbcType="VARCHAR" />
  11 + <result column="state" property="state" jdbcType="BIT" />
  12 + <result column="mobilePhone" property="mobilephone" jdbcType="VARCHAR" />
  13 + <result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
  14 + <result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
  15 + <result column="userFace" property="userface" jdbcType="VARCHAR" />
  16 + <result column="ext1" property="ext1" jdbcType="VARCHAR" />
  17 + <result column="ext2" property="ext2" jdbcType="VARCHAR" />
  18 + <result column="ext3" property="ext3" jdbcType="VARCHAR" />
15 </resultMap> 19 </resultMap>
16 <sql id="Base_Column_List" > 20 <sql id="Base_Column_List" >
17 - USER_ID, USERNAME, PASSWORD, STATE, CREATTIME, SEX, ADDRESS, BIRTHDAY, MOBILEPHONE,  
18 - UPDATETIME 21 + user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime,
  22 + updateTime, userFace, ext1, ext2, ext3
19 </sql> 23 </sql>
20 - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.math.BigDecimal" > 24 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21 select 25 select
22 <include refid="Base_Column_List" /> 26 <include refid="Base_Column_List" />
23 - from USERS  
24 - where USER_ID = #{userId,jdbcType=DECIMAL} 27 + from users
  28 + where user_id = #{userId,jdbcType=INTEGER}
25 </select> 29 </select>
26 <select id="selectByUsername" resultMap="BaseResultMap" parameterType="java.lang.String" > 30 <select id="selectByUsername" resultMap="BaseResultMap" parameterType="java.lang.String" >
27 - select  
28 - <include refid="Base_Column_List" />  
29 - from USERS  
30 - where USERNAME = #{username,jdbcType=VARCHAR}  
31 -</select> 31 + select
  32 + <include refid="Base_Column_List" />
  33 + from USERS
  34 + where USERNAME = #{username,jdbcType=VARCHAR}
  35 + </select>
32 <select id="selectAllUser" resultMap="BaseResultMap" > 36 <select id="selectAllUser" resultMap="BaseResultMap" >
33 select 37 select
34 <include refid="Base_Column_List" /> 38 <include refid="Base_Column_List" />
35 from USERS 39 from USERS
36 </select> 40 </select>
37 - <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal" >  
38 - delete from USERS  
39 - where USER_ID = #{userId,jdbcType=DECIMAL} 41 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  42 + delete from users
  43 + where user_id = #{userId,jdbcType=INTEGER}
40 </delete> 44 </delete>
41 <insert id="insert" parameterType="com.tianbo.warehouse.model.USERS" > 45 <insert id="insert" parameterType="com.tianbo.warehouse.model.USERS" >
42 - insert into USERS (USER_ID, USERNAME, PASSWORD,  
43 - STATE, CREATTIME, SEX,  
44 - ADDRESS, BIRTHDAY, MOBILEPHONE,  
45 - UPDATETIME)  
46 - values (#{userId,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},  
47 - #{state,jdbcType=DECIMAL}, #{creattime,jdbcType=TIMESTAMP}, #{sex,jdbcType=VARCHAR},  
48 - #{address,jdbcType=VARCHAR}, #{birthday,jdbcType=TIMESTAMP}, #{mobilephone,jdbcType=VARCHAR},  
49 - #{updatetime,jdbcType=TIMESTAMP}) 46 + insert into users (user_id, username, password,
  47 + birthday, sex, address,
  48 + state, mobilePhone, creatTime,
  49 + updateTime, userFace, ext1,
  50 + ext2, ext3)
  51 + values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  52 + #{birthday,jdbcType=TIMESTAMP}, #{sex,jdbcType=CHAR}, #{address,jdbcType=VARCHAR},
  53 + #{state,jdbcType=BIT}, #{mobilephone,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP},
  54 + #{updatetime,jdbcType=TIMESTAMP}, #{userface,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR},
  55 + #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})
50 </insert> 56 </insert>
51 <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.USERS" > 57 <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.USERS" >
52 - insert into USERS 58 + insert into users
53 <trim prefix="(" suffix=")" suffixOverrides="," > 59 <trim prefix="(" suffix=")" suffixOverrides="," >
54 <if test="userId != null" > 60 <if test="userId != null" >
55 - USER_ID, 61 + user_id,
56 </if> 62 </if>
57 <if test="username != null" > 63 <if test="username != null" >
58 - USERNAME, 64 + username,
59 </if> 65 </if>
60 <if test="password != null" > 66 <if test="password != null" >
61 - PASSWORD,  
62 - </if>  
63 - <if test="state != null" >  
64 - STATE, 67 + password,
65 </if> 68 </if>
66 - <if test="creattime != null" >  
67 - CREATTIME, 69 + <if test="birthday != null" >
  70 + birthday,
68 </if> 71 </if>
69 <if test="sex != null" > 72 <if test="sex != null" >
70 - SEX, 73 + sex,
71 </if> 74 </if>
72 <if test="address != null" > 75 <if test="address != null" >
73 - ADDRESS, 76 + address,
74 </if> 77 </if>
75 - <if test="birthday != null" >  
76 - BIRTHDAY, 78 + <if test="state != null" >
  79 + state,
77 </if> 80 </if>
78 <if test="mobilephone != null" > 81 <if test="mobilephone != null" >
79 - MOBILEPHONE, 82 + mobilePhone,
  83 + </if>
  84 + <if test="creattime != null" >
  85 + creatTime,
80 </if> 86 </if>
81 <if test="updatetime != null" > 87 <if test="updatetime != null" >
82 - UPDATETIME, 88 + updateTime,
  89 + </if>
  90 + <if test="userface != null" >
  91 + userFace,
  92 + </if>
  93 + <if test="ext1 != null" >
  94 + ext1,
  95 + </if>
  96 + <if test="ext2 != null" >
  97 + ext2,
  98 + </if>
  99 + <if test="ext3 != null" >
  100 + ext3,
83 </if> 101 </if>
84 </trim> 102 </trim>
85 <trim prefix="values (" suffix=")" suffixOverrides="," > 103 <trim prefix="values (" suffix=")" suffixOverrides="," >
86 <if test="userId != null" > 104 <if test="userId != null" >
87 - #{userId,jdbcType=DECIMAL}, 105 + #{userId,jdbcType=INTEGER},
88 </if> 106 </if>
89 <if test="username != null" > 107 <if test="username != null" >
90 #{username,jdbcType=VARCHAR}, 108 #{username,jdbcType=VARCHAR},
@@ -92,73 +110,101 @@ @@ -92,73 +110,101 @@
92 <if test="password != null" > 110 <if test="password != null" >
93 #{password,jdbcType=VARCHAR}, 111 #{password,jdbcType=VARCHAR},
94 </if> 112 </if>
95 - <if test="state != null" >  
96 - #{state,jdbcType=DECIMAL},  
97 - </if>  
98 - <if test="creattime != null" >  
99 - #{creattime,jdbcType=TIMESTAMP}, 113 + <if test="birthday != null" >
  114 + #{birthday,jdbcType=TIMESTAMP},
100 </if> 115 </if>
101 <if test="sex != null" > 116 <if test="sex != null" >
102 - #{sex,jdbcType=VARCHAR}, 117 + #{sex,jdbcType=CHAR},
103 </if> 118 </if>
104 <if test="address != null" > 119 <if test="address != null" >
105 #{address,jdbcType=VARCHAR}, 120 #{address,jdbcType=VARCHAR},
106 </if> 121 </if>
107 - <if test="birthday != null" >  
108 - #{birthday,jdbcType=TIMESTAMP}, 122 + <if test="state != null" >
  123 + #{state,jdbcType=BIT},
109 </if> 124 </if>
110 <if test="mobilephone != null" > 125 <if test="mobilephone != null" >
111 #{mobilephone,jdbcType=VARCHAR}, 126 #{mobilephone,jdbcType=VARCHAR},
112 </if> 127 </if>
  128 + <if test="creattime != null" >
  129 + #{creattime,jdbcType=TIMESTAMP},
  130 + </if>
113 <if test="updatetime != null" > 131 <if test="updatetime != null" >
114 #{updatetime,jdbcType=TIMESTAMP}, 132 #{updatetime,jdbcType=TIMESTAMP},
115 </if> 133 </if>
  134 + <if test="userface != null" >
  135 + #{userface,jdbcType=VARCHAR},
  136 + </if>
  137 + <if test="ext1 != null" >
  138 + #{ext1,jdbcType=VARCHAR},
  139 + </if>
  140 + <if test="ext2 != null" >
  141 + #{ext2,jdbcType=VARCHAR},
  142 + </if>
  143 + <if test="ext3 != null" >
  144 + #{ext3,jdbcType=VARCHAR},
  145 + </if>
116 </trim> 146 </trim>
117 </insert> 147 </insert>
118 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.USERS" > 148 <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.USERS" >
119 - update USERS 149 + update users
120 <set > 150 <set >
121 <if test="username != null" > 151 <if test="username != null" >
122 - USERNAME = #{username,jdbcType=VARCHAR}, 152 + username = #{username,jdbcType=VARCHAR},
123 </if> 153 </if>
124 <if test="password != null" > 154 <if test="password != null" >
125 - PASSWORD = #{password,jdbcType=VARCHAR},  
126 - </if>  
127 - <if test="state != null" >  
128 - STATE = #{state,jdbcType=DECIMAL}, 155 + password = #{password,jdbcType=VARCHAR},
129 </if> 156 </if>
130 - <if test="creattime != null" >  
131 - CREATTIME = #{creattime,jdbcType=TIMESTAMP}, 157 + <if test="birthday != null" >
  158 + birthday = #{birthday,jdbcType=TIMESTAMP},
132 </if> 159 </if>
133 <if test="sex != null" > 160 <if test="sex != null" >
134 - SEX = #{sex,jdbcType=VARCHAR}, 161 + sex = #{sex,jdbcType=CHAR},
135 </if> 162 </if>
136 <if test="address != null" > 163 <if test="address != null" >
137 - ADDRESS = #{address,jdbcType=VARCHAR}, 164 + address = #{address,jdbcType=VARCHAR},
138 </if> 165 </if>
139 - <if test="birthday != null" >  
140 - BIRTHDAY = #{birthday,jdbcType=TIMESTAMP}, 166 + <if test="state != null" >
  167 + state = #{state,jdbcType=BIT},
141 </if> 168 </if>
142 <if test="mobilephone != null" > 169 <if test="mobilephone != null" >
143 - MOBILEPHONE = #{mobilephone,jdbcType=VARCHAR}, 170 + mobilePhone = #{mobilephone,jdbcType=VARCHAR},
  171 + </if>
  172 + <if test="creattime != null" >
  173 + creatTime = #{creattime,jdbcType=TIMESTAMP},
144 </if> 174 </if>
145 <if test="updatetime != null" > 175 <if test="updatetime != null" >
146 - UPDATETIME = #{updatetime,jdbcType=TIMESTAMP}, 176 + updateTime = #{updatetime,jdbcType=TIMESTAMP},
  177 + </if>
  178 + <if test="userface != null" >
  179 + userFace = #{userface,jdbcType=VARCHAR},
  180 + </if>
  181 + <if test="ext1 != null" >
  182 + ext1 = #{ext1,jdbcType=VARCHAR},
  183 + </if>
  184 + <if test="ext2 != null" >
  185 + ext2 = #{ext2,jdbcType=VARCHAR},
  186 + </if>
  187 + <if test="ext3 != null" >
  188 + ext3 = #{ext3,jdbcType=VARCHAR},
147 </if> 189 </if>
148 </set> 190 </set>
149 - where USER_ID = #{userId,jdbcType=DECIMAL} 191 + where user_id = #{userId,jdbcType=INTEGER}
150 </update> 192 </update>
151 <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.USERS" > 193 <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.USERS" >
152 - update USERS  
153 - set USERNAME = #{username,jdbcType=VARCHAR},  
154 - PASSWORD = #{password,jdbcType=VARCHAR},  
155 - STATE = #{state,jdbcType=DECIMAL},  
156 - CREATTIME = #{creattime,jdbcType=TIMESTAMP},  
157 - SEX = #{sex,jdbcType=VARCHAR},  
158 - ADDRESS = #{address,jdbcType=VARCHAR},  
159 - BIRTHDAY = #{birthday,jdbcType=TIMESTAMP},  
160 - MOBILEPHONE = #{mobilephone,jdbcType=VARCHAR},  
161 - UPDATETIME = #{updatetime,jdbcType=TIMESTAMP}  
162 - where USER_ID = #{userId,jdbcType=DECIMAL} 194 + update users
  195 + set username = #{username,jdbcType=VARCHAR},
  196 + password = #{password,jdbcType=VARCHAR},
  197 + birthday = #{birthday,jdbcType=TIMESTAMP},
  198 + sex = #{sex,jdbcType=CHAR},
  199 + address = #{address,jdbcType=VARCHAR},
  200 + state = #{state,jdbcType=BIT},
  201 + mobilePhone = #{mobilephone,jdbcType=VARCHAR},
  202 + creatTime = #{creattime,jdbcType=TIMESTAMP},
  203 + updateTime = #{updatetime,jdbcType=TIMESTAMP},
  204 + userFace = #{userface,jdbcType=VARCHAR},
  205 + ext1 = #{ext1,jdbcType=VARCHAR},
  206 + ext2 = #{ext2,jdbcType=VARCHAR},
  207 + ext3 = #{ext3,jdbcType=VARCHAR}
  208 + where user_id = #{userId,jdbcType=INTEGER}
163 </update> 209 </update>
164 </mapper> 210 </mapper>