Commit 8d2963a6 by whl

mybatis逆向工程配置

parent db240044
......@@ -91,6 +91,14 @@
</dependency>
<!--endregion-->
<!--region Oracle-->
<dependency>
<groupId>org.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>6.0</version>
</dependency>
<!--endregion-->
<!--region mssql-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
......
package com.bsoft.api.mapper;
import com.bsoft.api.model.SysUser;
import java.math.BigDecimal;
import java.util.List;
public interface SysUserMapper {
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table LL.SYS_USER
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
int deleteByPrimaryKey(BigDecimal id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table LL.SYS_USER
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
int insert(SysUser record);
SysUser selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table LL.SYS_USER
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
SysUser selectByPrimaryKey(BigDecimal id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table LL.SYS_USER
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
List<SysUser> selectAll();
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table LL.SYS_USER
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
int updateByPrimaryKey(SysUser record);
SysUser selectByCode(String code);
}
\ No newline at end of file
package com.bsoft.api.model;
import java.math.BigDecimal;
import java.util.Date;
public class SysUser {
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.ID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private BigDecimal id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.CREATE_DATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Date createDate;
private Integer createUserid;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.CREATE_USERID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private BigDecimal createUserid;
private Integer state;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.STATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private BigDecimal state;
private String userCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.USER_CODE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object userCode;
private String userName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.USER_NAME
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object userName;
private String password;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.PASSWORD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object password;
private String idcard;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.IDCARD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object idcard;
private String sex;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.SEX
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object sex;
private String mobile;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column LL.SYS_USER.MOBILE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
private Object mobile;
public Integer getId() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.ID
*
* @return the value of LL.SYS_USER.ID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public BigDecimal getId() {
return id;
}
public void setId(Integer id) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.ID
*
* @param id the value for LL.SYS_USER.ID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setId(BigDecimal id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.CREATE_DATE
*
* @return the value of LL.SYS_USER.CREATE_DATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Date getCreateDate() {
return createDate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.CREATE_DATE
*
* @param createDate the value for LL.SYS_USER.CREATE_DATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Integer getCreateUserid() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.CREATE_USERID
*
* @return the value of LL.SYS_USER.CREATE_USERID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public BigDecimal getCreateUserid() {
return createUserid;
}
public void setCreateUserid(Integer createUserid) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.CREATE_USERID
*
* @param createUserid the value for LL.SYS_USER.CREATE_USERID
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setCreateUserid(BigDecimal createUserid) {
this.createUserid = createUserid;
}
public Integer getState() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.STATE
*
* @return the value of LL.SYS_USER.STATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public BigDecimal getState() {
return state;
}
public void setState(Integer state) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.STATE
*
* @param state the value for LL.SYS_USER.STATE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setState(BigDecimal state) {
this.state = state;
}
public String getUserCode() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.USER_CODE
*
* @return the value of LL.SYS_USER.USER_CODE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.USER_CODE
*
* @param userCode the value for LL.SYS_USER.USER_CODE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setUserCode(Object userCode) {
this.userCode = userCode;
}
public String getUserName() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.USER_NAME
*
* @return the value of LL.SYS_USER.USER_NAME
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getUserName() {
return userName;
}
public void setUserName(String userName) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.USER_NAME
*
* @param userName the value for LL.SYS_USER.USER_NAME
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setUserName(Object userName) {
this.userName = userName;
}
public String getPassword() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.PASSWORD
*
* @return the value of LL.SYS_USER.PASSWORD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getPassword() {
return password;
}
public void setPassword(String password) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.PASSWORD
*
* @param password the value for LL.SYS_USER.PASSWORD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setPassword(Object password) {
this.password = password;
}
public String getIdcard() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.IDCARD
*
* @return the value of LL.SYS_USER.IDCARD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getIdcard() {
return idcard;
}
public void setIdcard(String idcard) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.IDCARD
*
* @param idcard the value for LL.SYS_USER.IDCARD
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setIdcard(Object idcard) {
this.idcard = idcard;
}
public String getSex() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.SEX
*
* @return the value of LL.SYS_USER.SEX
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getSex() {
return sex;
}
public void setSex(String sex) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.SEX
*
* @param sex the value for LL.SYS_USER.SEX
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setSex(Object sex) {
this.sex = sex;
}
public String getMobile() {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column LL.SYS_USER.MOBILE
*
* @return the value of LL.SYS_USER.MOBILE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public Object getMobile() {
return mobile;
}
public void setMobile(String mobile) {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column LL.SYS_USER.MOBILE
*
* @param mobile the value for LL.SYS_USER.MOBILE
*
* @mbg.generated Mon Oct 21 11:03:43 CST 2019
*/
public void setMobile(Object mobile) {
this.mobile = mobile;
}
}
\ No newline at end of file
......@@ -2,62 +2,84 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsoft.api.mapper.SysUserMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SysUser">
<id column="ID" jdbcType="INTEGER" property="id" />
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
<id column="ID" jdbcType="DECIMAL" property="id" />
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
<result column="CREATE_USERID" jdbcType="INTEGER" property="createUserid" />
<result column="STATE" jdbcType="INTEGER" property="state" />
<result column="USER_CODE" jdbcType="VARCHAR" property="userCode" />
<result column="USER_NAME" jdbcType="VARCHAR" property="userName" />
<result column="PASSWORD" jdbcType="VARCHAR" property="password" />
<result column="IDCARD" jdbcType="VARCHAR" property="idcard" />
<result column="SEX" jdbcType="VARCHAR" property="sex" />
<result column="MOBILE" jdbcType="VARCHAR" property="mobile" />
<result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid" />
<result column="STATE" jdbcType="DECIMAL" property="state" />
<result column="USER_CODE" jdbcType="OTHER" property="userCode" />
<result column="USER_NAME" jdbcType="OTHER" property="userName" />
<result column="PASSWORD" jdbcType="OTHER" property="password" />
<result column="IDCARD" jdbcType="OTHER" property="idcard" />
<result column="SEX" jdbcType="OTHER" property="sex" />
<result column="MOBILE" jdbcType="OTHER" property="mobile" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_user
where ID = #{id,jdbcType=INTEGER}
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
delete from LL.SYS_USER
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert id="insert" parameterType="com.bsoft.api.model.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
select SEQ_SYS_USER_ID.nextval from dual
</selectKey>
insert into sys_user (CREATE_DATE, CREATE_USERID, STATE,
insert into LL.SYS_USER (CREATE_DATE, CREATE_USERID, STATE,
USER_CODE, USER_NAME, PASSWORD,
IDCARD, SEX, MOBILE
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{userCode,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{idcard,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}
)
IDCARD, SEX, MOBILE)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{userCode,jdbcType=OTHER}, #{userName,jdbcType=OTHER}, #{password,jdbcType=OTHER},
#{idcard,jdbcType=OTHER}, #{sex,jdbcType=OTHER}, #{mobile,jdbcType=OTHER})
</insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SysUser">
update sys_user
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
update LL.SYS_USER
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=INTEGER},
STATE = #{state,jdbcType=INTEGER},
USER_CODE = #{userCode,jdbcType=VARCHAR},
USER_NAME = #{userName,jdbcType=VARCHAR},
PASSWORD = #{password,jdbcType=VARCHAR},
IDCARD = #{idcard,jdbcType=VARCHAR},
SEX = #{sex,jdbcType=VARCHAR},
MOBILE = #{mobile,jdbcType=VARCHAR}
where ID = #{id,jdbcType=INTEGER}
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
STATE = #{state,jdbcType=DECIMAL},
USER_CODE = #{userCode,jdbcType=OTHER},
USER_NAME = #{userName,jdbcType=OTHER},
PASSWORD = #{password,jdbcType=OTHER},
IDCARD = #{idcard,jdbcType=OTHER},
SEX = #{sex,jdbcType=OTHER},
MOBILE = #{mobile,jdbcType=OTHER}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_CODE, USER_NAME, PASSWORD, IDCARD,
SEX, MOBILE
from sys_user
where ID = #{id,jdbcType=INTEGER}
from LL.SYS_USER
where ID = #{id,jdbcType=DECIMAL}
</select>
<select id="selectAll" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Mon Oct 21 11:03:43 CST 2019.
-->
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_CODE, USER_NAME, PASSWORD, IDCARD,
SEX, MOBILE
from sys_user
</select>
<select id="selectByCode" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_CODE, USER_NAME, PASSWORD, IDCARD,
SEX, MOBILE
from sys_user
where USER_CODE=#{code,jdbcType=VARCHAR}
from LL.SYS_USER
</select>
</mapper>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<!-- 引入配置文件 -->
<properties resource="./application-dev.properties"/>
<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<context id="Oracle" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- 生成的文件编码 -->
......@@ -16,7 +16,9 @@
<!--<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>-->
<!--</plugin>-->
<commentGenerator>
<property name="suppressAllComments" value="true"/>
<property name="suppressAllComments" value="false"/>
<!-- 数据库注释支持 -->
<!-- <property name="addRemarkComments" value="true"/>-->
</commentGenerator>
<!-- 数据库连接属性 -->
<jdbcConnection driverClass="${spring.datasource.driver-class-name}"
......@@ -24,9 +26,9 @@
userId="${spring.datasource.username}"
password="${spring.datasource.password}">
<!-- 针对oracle数据库 获取字段注释 -->
<!--<property enName="remarksReporting" value="true"></property>-->
<property name="remarksReporting" value="true"></property>
<!-- 针对mysql数据库 获取字段注释 -->
<property name="useInformationSchema" value="true"></property>
<!-- <property name="useInformationSchema" value="true"></property>-->
</jdbcConnection>
<!-- 生成实体类配置 -->
<javaModelGenerator targetPackage="com.bsoft.api.model" targetProject="src/main/java"/>
......@@ -35,8 +37,9 @@
<!-- 生成映射接口配置 -->
<javaClientGenerator targetPackage="com.bsoft.api.mapper" targetProject="src/main/java" type="XMLMAPPER"/>
<table tableName="sys_user">
<generatedKey column="id" sqlStatement="Mysql" identity="true"/>
<table tableName="sys_user" schema="ll" >
<!-- 主键生成方式 -->
<generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />
</table>
</context>
<!--<context id="sqlserver" targetRuntime="MyBatis3Simple" defaultModelType="flat">-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment