Commit 7cabc39a authored by qiankunpingtai's avatar qiankunpingtai
Browse files

切换到jsh的版本

parent 9182e734
......@@ -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>
......
......@@ -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
<?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,19 +28,16 @@
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'
......@@ -52,11 +45,11 @@
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
......@@ -116,12 +109,15 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getUserListByLoginName" resultMap="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap">
<select id="getUserListByUserNameOrLoginName" 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
......@@ -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>
......
Supports Markdown
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