Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
7cabc39a
Commit
7cabc39a
authored
Nov 08, 2019
by
qiankunpingtai
Browse files
切换到jsh的版本
parent
9182e734
Changes
125
Hide whitespace changes
Inline
Side-by-side
src/main/resources/mapper_xml/TenantMapper.xml
View file @
7cabc39a
<?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.jsh.erp.datasource.mappers.TenantMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"tenant_id"
property=
"tenantId"
jdbcType=
"BIGINT"
/>
<result
column=
"login_name"
property=
"loginName"
jdbcType=
"VARCHAR"
/>
<result
column=
"user_num_limit"
property=
"userNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"bills_num_limit"
property=
"billsNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where
>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"tenant_id"
property=
"tenantId"
jdbcType=
"BIGINT"
/>
<result
column=
"login_name"
property=
"loginName"
jdbcType=
"VARCHAR"
/>
<result
column=
"user_num_limit"
property=
"userNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"bills_num_limit"
property=
"billsNumLimit"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where
>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where
>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, tenant_id, login_name, user_num_limit, bills_num_limit, create_time
</sql>
<select
id=
"selectByExample"
resultMap=
"BaseResultMap"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</trim>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant (id, tenant_id, login_name,
user_num_limit, bills_num_limit, create_time
)
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"tenantId != null"
>
tenant_id,
</if>
<if
test=
"loginName != null"
>
login_name,
</if>
<if
test=
"userNumLimit != null"
>
user_num_limit,
</if>
<if
test=
"billsNumLimit != null"
>
bills_num_limit,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"loginName != null"
>
#{loginName,jdbcType=VARCHAR},
</if>
<if
test=
"userNumLimit != null"
>
#{userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"billsNumLimit != null"
>
#{billsNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
resultType=
"java.lang.Integer"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
<set
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if
test=
"record.loginName != null"
>
login_name = #{record.loginName,jdbcType=VARCHAR},
</if>
<if
test=
"record.userNumLimit != null"
>
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"record.billsNumLimit != null"
>
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where
>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
set id = #{record.id,jdbcType=BIGINT},
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, tenant_id, login_name, user_num_limit, bills_num_limit, create_time
</sql>
<select
id=
"selectByExample"
resultMap=
"BaseResultMap"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant (id, tenant_id, login_name,
user_num_limit, bills_num_limit, create_time
)
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_tenant
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"tenantId != null"
>
tenant_id,
</if>
<if
test=
"loginName != null"
>
login_name,
</if>
<if
test=
"userNumLimit != null"
>
user_num_limit,
</if>
<if
test=
"billsNumLimit != null"
>
bills_num_limit,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"loginName != null"
>
#{loginName,jdbcType=VARCHAR},
</if>
<if
test=
"userNumLimit != null"
>
#{userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"billsNumLimit != null"
>
#{billsNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.TenantExample"
resultType=
"java.lang.Integer"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_tenant
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
<set
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if
test=
"record.loginName != null"
>
login_name = #{record.loginName,jdbcType=VARCHAR},
</if>
<if
test=
"record.userNumLimit != null"
>
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"record.billsNumLimit != null"
>
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
<set
>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"loginName != null"
>
login_name = #{loginName,jdbcType=VARCHAR},
</if>
<if
test=
"userNumLimit != null"
>
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"billsNumLimit != null"
>
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
set tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
set id = #{record.id,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
login_name = #{record.loginName,jdbcType=VARCHAR},
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
<set
>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if
test=
"loginName != null"
>
login_name = #{loginName,jdbcType=VARCHAR},
</if>
<if
test=
"userNumLimit != null"
>
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
</if>
<if
test=
"billsNumLimit != null"
>
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.jsh.erp.datasource.entities.Tenant"
>
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_tenant
set tenant_id = #{tenantId,jdbcType=BIGINT},
login_name = #{loginName,jdbcType=VARCHAR},
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/UnitMapperEx.xml
View file @
7cabc39a
...
...
@@ -5,9 +5,8 @@
select *
FROM jsh_unit
where 1=1
<if
test=
"name != null and name != ''"
>
<bind
name=
"name"
value=
"'%' + _parameter.name + '%'"
/>
and UName like #{name}
<if
test=
"name != null"
>
and UName like '%${name}%'
</if>
and ifnull(delete_Flag,'0') !='1'
<if
test=
"offset != null and rows != null"
>
...
...
@@ -19,9 +18,8 @@
COUNT(id)
FROM jsh_unit
WHERE 1=1
<if
test=
"name != null and name != ''"
>
<bind
name=
"name"
value=
"'%' + _parameter.name + '%'"
/>
and UName like #{name}
<if
test=
"name != null"
>
and UName like '%${name}%'
</if>
and ifnull(delete_Flag,'0') !='1'
</select>
...
...
src/main/resources/mapper_xml/UserBusinessMapper.xml
View file @
7cabc39a
...
...
@@ -12,7 +12,6 @@
<result
column=
"Value"
jdbcType=
"VARCHAR"
property=
"value"
/>
<result
column=
"BtnStr"
jdbcType=
"VARCHAR"
property=
"btnstr"
/>
<result
column=
"delete_Flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -85,7 +84,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, Type, KeyId, Value, BtnStr, delete_Flag
, tenant_id
Id, Type, KeyId, Value, BtnStr, delete_Flag
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.UserBusinessExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -139,11 +138,11 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_userbusiness (Id, Type, KeyId,
Value, BtnStr, delete_Flag
,
tenant_id
)
Value, BtnStr, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{keyid,jdbcType=VARCHAR},
#{value,jdbcType=VARCHAR}, #{btnstr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
,
#{tenantId,jdbcType=BIGINT}
)
#{value,jdbcType=VARCHAR}, #{btnstr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.UserBusiness"
>
<!--
...
...
@@ -170,9 +169,6 @@
<if
test=
"deleteFlag != null"
>
delete_Flag,
</if>
<if
test=
"tenantId != null"
>
tenant_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -193,9 +189,6 @@
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.UserBusinessExample"
resultType=
"java.lang.Integer"
>
...
...
@@ -233,9 +226,6 @@
<if
test=
"record.deleteFlag != null"
>
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -252,8 +242,7 @@
KeyId = #{record.keyid,jdbcType=VARCHAR},
Value = #{record.value,jdbcType=VARCHAR},
BtnStr = #{record.btnstr,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -280,9 +269,6 @@
<if
test=
"deleteFlag != null"
>
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -296,8 +282,7 @@
KeyId = #{keyid,jdbcType=VARCHAR},
Value = #{value,jdbcType=VARCHAR},
BtnStr = #{btnstr,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/UserMapperEx.xml
View file @
7cabc39a
<?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.jsh.erp.datasource.mappers.UserMapperEx"
>
<resultMap
extends=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
id=
"ResultMapEx"
type=
"com.jsh.erp.datasource.entities.UserEx"
>
<result
column=
"orgaId"
jdbcType=
"BIGINT"
property=
"orgaId"
/>
<result
column=
"org_abr"
jdbcType=
"VARCHAR"
property=
"orgAbr"
/>
<result
column=
"user_blng_orga_dspl_seq"
jdbcType=
"VARCHAR"
property=
"userBlngOrgaDsplSeq"
/>
<result
column=
"orgaUserRelId"
jdbcType=
"BIGINT"
property=
"orgaUserRelId"
/>
<resultMap
extends=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
id=
"ResultMapEx"
type=
"com.jsh.erp.datasource.entities.UserEx"
>
<result
column=
"orgaId"
jdbcType=
"BIGINT"
property=
"orgaId"
/>
<result
column=
"org_abr"
jdbcType=
"VARCHAR"
property=
"orgAbr"
/>
<result
column=
"user_blng_orga_dspl_seq"
jdbcType=
"VARCHAR"
property=
"userBlngOrgaDsplSeq"
/>
<result
column=
"orgaUserRelId"
jdbcType=
"BIGINT"
property=
"orgaUserRelId"
/>
</resultMap>
<select
id=
"selectByConditionUser"
parameterType=
"com.jsh.erp.datasource.entities.UserExample"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
<select
id=
"selectByConditionUser"
parameterType=
"com.jsh.erp.datasource.entities.UserExample"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
select *
FROM jsh_user
where 1=1
and ifnull(status,'0') not in('1','2')
<if
test=
"userName != null and userName != ''"
>
<bind
name=
"userName"
value=
"'%' + _parameter.userName + '%'"
/>
and username like #{userName}
<if
test=
"userName != null"
>
and username like '%${userName}%'
</if>
<if
test=
"loginName != null and loginName != ''"
>
<bind
name=
"loginName"
value=
"'%' + _parameter.loginName + '%'"
/>
and loginame like #{loginName}
<if
test=
"loginName != null"
>
and loginame like '%${loginName}%'
</if>
<if
test=
"offset != null and rows != null"
>
limit #{offset},#{rows}
...
...
@@ -32,37 +28,34 @@
FROM jsh_user
WHERE 1=1
and ifnull(status,'0') not in('1','2')
<if
test=
"userName != null and userName != ''"
>
<bind
name=
"userName"
value=
"'%' + _parameter.userName + '%'"
/>
and username like #{userName}
<if
test=
"userName != null"
>
and username like '%${userName}%'
</if>
<if
test=
"loginName != null and loginName != ''"
>
<bind
name=
"loginName"
value=
"'%' + _parameter.loginName + '%'"
/>
and loginame like #{loginName}
<if
test=
"loginName != null"
>
and loginame like '%${loginName}%'
</if>
</select>
<select
id=
"getUserList"
parameterType=
"java.util.Map"
resultMap=
"ResultMapEx"
>
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem,org.id as
orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
rel.id as orgaUserRelId
FROM jsh_user user
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.org_stcd,'0') !='5'
left join jsh_organization org on rel.orga_id=org.id and
ifnull(org.org_stcd,'0') !='5'
where 1=1
and ifnull(user.status,'0') not in('1','2')
<if
test=
"userName != null and userName != ''"
>
<bind
name=
"userName"
value=
"'%' + _parameter.userName + '%'"
/>
<bind
name=
"userName"
value=
"'%' + _parameter.userName + '%'"
/>
and user.userName like #{userName}
</if>
<if
test=
"loginName != null and loginName != ''"
>
<bind
name=
"loginName"
value=
"'%' + _parameter.loginName + '%'"
/>
<bind
name=
"loginName"
value=
"'%' + _parameter.loginName + '%'"
/>
and user.loginName like #{loginName}
</if>
order by user.id desc
</select>
<insert
id=
"addUser"
parameterType=
"com.jsh.erp.datasource.entities.UserEx"
useGeneratedKeys=
"true"
keyProperty=
"id"
keyColumn=
"id"
>
useGeneratedKeys=
"true"
keyProperty=
"id"
keyColumn=
"id"
>
insert into jsh_user (username, loginame,
password, position,
email, phonenum, ismanager,
...
...
@@ -116,12 +109,15 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"getUserListByLoginName"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
<select
id=
"getUserListBy
UserNameOr
LoginName"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem
,user.tenant_id
user.description, user.remark,user.isystem
FROM jsh_user user
where 1=1
and ifnull(user.status,'0') not in('1','2')
<if
test=
"userName != null and userName != ''"
>
and user.userName = #{userName}
</if>
<if
test=
"loginame != null and loginame != ''"
>
and user.loginame = #{loginame}
</if>
...
...
@@ -188,42 +184,4 @@
and ifnull(org_stcd,'0') !='5'
order by sort asc
</select>
<select
id=
"getUserListByUserNameAndTenantId"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem
FROM jsh_user user
where 1=1
and ifnull(user.status,'0') not in('1','2')
<if
test=
"userName != null and userName != ''"
>
and user.userName = #{userName}
</if>
<choose>
<when
test=
"tenantId != null"
>
and user.tenant_id = #{tenantId}
</when>
<otherwise>
AND user.tenant_id is null
</otherwise>
</choose>
order by user.id desc
</select>
<select
id=
"addRegisterUserNotInclueUser"
resultType=
"java.lang.String"
>
select registerUserTemplate(#{userId},#{tenantId},#{roleId}) from dual;
</select>
<select
id=
"getUserListByloginNameAndPassword"
resultMap=
"com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap"
>
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem,user.tenant_id
FROM jsh_user user
where 1=1
and ifnull(user.status,'0') not in('1','2')
<if
test=
"loginame != null and loginame != ''"
>
and user.loginame = #{loginame}
</if>
<if
test=
"password != null and password != ''"
>
and user.password = #{password}
</if>
order by user.id desc
</select>
</mapper>
\ No newline at end of file
src/test/resources/generatorConfig.xml
View file @
7cabc39a
...
...
@@ -5,7 +5,7 @@
<generatorConfiguration>
<classPathEntry
location=
"
C
:\
Users\cjl\.m2\
repository\mysql\mysql-connector-java\5.1.47\mysql-connector-java-5.1.47.jar"
/>
location=
"
E
:\
maven-
repository\
default\
mysql\mysql-connector-java\5.1.47\mysql-connector-java-5.1.47.jar"
/>
<context
id=
"DB2Tables"
targetRuntime=
"MyBatis3"
defaultModelType=
"flat"
>
<commentGenerator>
...
...
Prev
1
…
3
4
5
6
7
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment