修复进销存合并

This commit is contained in:
2022-05-27 17:32:15 +08:00
parent 9f394d71a1
commit e01f90088f
160 changed files with 386 additions and 8422 deletions
@@ -1,6 +1,6 @@
<?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.zsw.erp.datasource.mappers.LogMapper">
<mapper namespace="com.zsw.erp.datasource.mappers.ErpLogMapper">
<resultMap id="BaseResultMap" type="com.zsw.erp.datasource.entities.Log">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
@@ -1,7 +1,7 @@
<?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.zsw.erp.datasource.mappers.LogMapperEx">
<resultMap extends="com.zsw.erp.datasource.mappers.LogMapper.BaseResultMap" id="ResultExMap" type="com.zsw.erp.datasource.vo.LogVo4List">
<resultMap extends="com.zsw.erp.datasource.mappers.ErpLogMapper.BaseResultMap" id="ResultExMap" type="com.zsw.erp.datasource.vo.LogVo4List">
<result column="userName" jdbcType="VARCHAR" property="userName" />
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
</resultMap>
@@ -1,6 +1,6 @@
<?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.zsw.erp.datasource.mappers.SystemConfigMapper">
<mapper namespace="com.zsw.erp.datasource.mappers.ErpSystemConfigMapper">
<resultMap id="BaseResultMap" type="com.zsw.erp.datasource.entities.SystemConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
@@ -1,7 +1,7 @@
<?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.zsw.erp.datasource.mappers.SystemConfigMapperEx">
<select id="selectByConditionSystemConfig" parameterType="com.zsw.erp.datasource.entities.SystemConfigExample" resultMap="com.zsw.erp.datasource.mappers.SystemConfigMapper.BaseResultMap">
<select id="selectByConditionSystemConfig" parameterType="com.zsw.erp.datasource.entities.SystemConfigExample" resultMap="com.zsw.erp.datasource.mappers.ErpSystemConfigMapper.BaseResultMap">
select *
FROM jsh_system_config
where 1=1
@@ -1,243 +0,0 @@
<?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.zsw.erp.datasource.mappers.RoleMapper">
<resultMap id="BaseResultMap" type="com.zsw.erp.datasource.entities.Role">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="value" jdbcType="VARCHAR" property="value" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, type, value, description, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.zsw.erp.datasource.entities.RoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_role
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_role
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.zsw.erp.datasource.entities.RoleExample">
delete from jsh_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zsw.erp.datasource.entities.Role">
insert into jsh_role (id, name, type,
value, description, tenant_id,
delete_flag)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{value,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT},
#{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zsw.erp.datasource.entities.Role">
insert into jsh_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="type != null">
type,
</if>
<if test="value != null">
value,
</if>
<if test="description != null">
description,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="value != null">
#{value,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zsw.erp.datasource.entities.RoleExample" resultType="java.lang.Long">
select count(*) from jsh_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_role
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.value != null">
value = #{record.value,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_role
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
value = #{record.value,jdbcType=VARCHAR},
description = #{record.description,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>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zsw.erp.datasource.entities.Role">
update jsh_role
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="value != null">
value = #{value,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.zsw.erp.datasource.entities.Role">
update jsh_role
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
value = #{value,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
@@ -1,38 +0,0 @@
<?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.zsw.erp.datasource.mappers.RoleMapperEx">
<select id="selectByConditionRole" resultMap="com.zsw.erp.datasource.mappers.RoleMapper.BaseResultMap">
SELECT *
FROM jsh_role
WHERE 1=1
and ifnull(delete_flag,'0') !='1'
<if test="name != null">
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>;
</select>
<select id="countsByRole" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_role
WHERE 1=1
and ifnull(delete_flag,'0') !='1'
<if test="name != null">
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
</select>
<update id="batchDeleteRoleByIds">
update jsh_role
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>
@@ -1,205 +0,0 @@
<?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.zsw.erp.datasource.mappers.TenantMapper">
<resultMap id="BaseResultMap" type="com.zsw.erp.datasource.entities.Tenant">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
<result column="user_num_limit" jdbcType="INTEGER" property="userNumLimit" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="enabled" jdbcType="BIT" property="enabled" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, tenant_id, login_name, user_num_limit, type, enabled, create_time, expire_time,
remark
</sql>
<select id="selectByExample" parameterType="com.zsw.erp.datasource.entities.TenantExample" resultMap="BaseResultMap">
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" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_tenant
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.zsw.erp.datasource.entities.TenantExample">
delete from jsh_tenant
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<select id="countByExample" parameterType="com.zsw.erp.datasource.entities.TenantExample" resultType="java.lang.Long">
select count(*) from jsh_tenant
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
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.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.enabled != null">
enabled = #{record.enabled,jdbcType=BIT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.expireTime != null">
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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},
type = #{record.type,jdbcType=VARCHAR},
enabled = #{record.enabled,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zsw.erp.datasource.entities.Tenant">
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="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="enabled != null">
enabled = #{enabled,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="expireTime != null">
expire_time = #{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.zsw.erp.datasource.entities.Tenant">
update jsh_tenant
set tenant_id = #{tenantId,jdbcType=BIGINT},
login_name = #{loginName,jdbcType=VARCHAR},
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
type = #{type,jdbcType=VARCHAR},
enabled = #{enabled,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
expire_time = #{expireTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
@@ -1,43 +0,0 @@
<?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.zsw.erp.datasource.mappers.TenantMapperEx">
<resultMap extends="com.zsw.erp.datasource.mappers.LogMapper.BaseResultMap" id="ResultMapEx" type="com.zsw.erp.datasource.entities.TenantEx">
</resultMap>
<select id="selectByConditionTenant" parameterType="com.zsw.erp.datasource.entities.TenantExample" resultMap="ResultMapEx">
select *
FROM jsh_tenant
where 1=1
<if test="loginName != null">
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
and login_name like #{bindLoginName}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="enabled != null and enabled != ''">
and enabled = #{enabled}
</if>
order by id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByTenant" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_tenant
WHERE 1=1
<if test="loginName != null">
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
and login_name like #{bindLoginName}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="enabled != null and enabled != ''">
and enabled = #{enabled}
</if>
</select>
</mapper>
@@ -1,15 +0,0 @@
<?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.zsw.erp.datasource.mappers.UserBusinessMapperEx">
<update id="batchDeleteUserBusinessByIds">
update jsh_user_business
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>
@@ -1,250 +0,0 @@
<?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.zsw.erp.datasource.mappers.UserMapper">
<resultMap id="BaseResultMap" type="com.zsw.erp.datasource.entities.User">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="position" jdbcType="VARCHAR" property="position" />
<result column="department" jdbcType="VARCHAR" property="department" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="phonenum" jdbcType="VARCHAR" property="phonenum" />
<result column="ismanager" jdbcType="TINYINT" property="ismanager" />
<result column="isystem" jdbcType="TINYINT" property="isystem" />
<result column="Status" jdbcType="TINYINT" property="status" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, username, login_name, password, position, department, email, phonenum, ismanager,
isystem, Status, description, remark, tenant_id
</sql>
<select id="selectByExample" parameterType="com.zsw.erp.datasource.entities.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_user
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_user
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.zsw.erp.datasource.entities.UserExample">
delete from jsh_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<select id="countByExample" parameterType="com.zsw.erp.datasource.entities.UserExample" resultType="java.lang.Long">
select count(*) from jsh_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.loginName != null">
login_name = #{record.loginName,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.position != null">
position = #{record.position,jdbcType=VARCHAR},
</if>
<if test="record.department != null">
department = #{record.department,jdbcType=VARCHAR},
</if>
<if test="record.email != null">
email = #{record.email,jdbcType=VARCHAR},
</if>
<if test="record.phonenum != null">
phonenum = #{record.phonenum,jdbcType=VARCHAR},
</if>
<if test="record.ismanager != null">
ismanager = #{record.ismanager,jdbcType=TINYINT},
</if>
<if test="record.isystem != null">
isystem = #{record.isystem,jdbcType=TINYINT},
</if>
<if test="record.status != null">
Status = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,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" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_user
set id = #{record.id,jdbcType=BIGINT},
username = #{record.username,jdbcType=VARCHAR},
login_name = #{record.loginName,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
position = #{record.position,jdbcType=VARCHAR},
department = #{record.department,jdbcType=VARCHAR},
email = #{record.email,jdbcType=VARCHAR},
phonenum = #{record.phonenum,jdbcType=VARCHAR},
ismanager = #{record.ismanager,jdbcType=TINYINT},
isystem = #{record.isystem,jdbcType=TINYINT},
Status = #{record.status,jdbcType=TINYINT},
description = #{record.description,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zsw.erp.datasource.entities.User">
update jsh_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="loginName != null">
login_name = #{loginName,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="position != null">
position = #{position,jdbcType=VARCHAR},
</if>
<if test="department != null">
department = #{department,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="phonenum != null">
phonenum = #{phonenum,jdbcType=VARCHAR},
</if>
<if test="ismanager != null">
ismanager = #{ismanager,jdbcType=TINYINT},
</if>
<if test="isystem != null">
isystem = #{isystem,jdbcType=TINYINT},
</if>
<if test="status != null">
Status = #{status,jdbcType=TINYINT},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.zsw.erp.datasource.entities.User">
update jsh_user
set username = #{username,jdbcType=VARCHAR},
login_name = #{loginName,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
position = #{position,jdbcType=VARCHAR},
department = #{department,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
phonenum = #{phonenum,jdbcType=VARCHAR},
ismanager = #{ismanager,jdbcType=TINYINT},
isystem = #{isystem,jdbcType=TINYINT},
Status = #{status,jdbcType=TINYINT},
description = #{description,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
@@ -1,135 +0,0 @@
<?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.zsw.erp.datasource.mappers.UserMapperEx">
<resultMap extends="com.zsw.erp.datasource.mappers.UserMapper.BaseResultMap" id="ResultMapEx" type="com.zsw.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" />
<result column="roleId" jdbcType="VARCHAR" property="roleId" />
<result column="roleName" jdbcType="VARCHAR" property="roleName" />
</resultMap>
<!-- on ub.value=concat("[",r.id,"]") 换成 ub.tenant_id = r.tenant_id 替换掉默认权限 -->
<select id="selectByConditionUser" parameterType="com.zsw.erp.datasource.entities.UserExample" resultMap="ResultMapEx">
select tb.*,
(select r.id from jsh_user_business ub
left join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
where ub.type='UserRole' and ub.key_id=tb.id limit 0,1) roleId,
(select r.name from jsh_user_business ub
left join jsh_role r
on ub.value=concat("[",r.id,"]")
and ifnull(r.delete_flag,'0') !='1'
where ub.type='UserRole' and ub.key_id=tb.id limit 0,1) roleName
from (
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,user.status,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.delete_flag,'0') !='1'
where 1=1
and user.status !='1'
<if test="userName != null">
<bind name="bindUserName" value="'%'+userName+'%'"/>
and user.username like #{bindUserName}
</if>
<if test="loginName != null">
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
and user.login_name like #{bindLoginName}
</if>
order by rel.user_blng_orga_dspl_seq,user.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
) tb
</select>
<select id="countsByUser" resultType="java.lang.Long">
select count(user.id)
FROM jsh_user user
where 1=1
and user.status !='1'
<if test="userName != null">
<bind name="bindUserName" value="'%'+userName+'%'"/>
and user.username like #{bindUserName}
</if>
<if test="loginName != null">
<bind name="bindLoginName" value="'%'+loginName+'%'"/>
and user.login_name like #{bindLoginName}
</if>
</select>
<select id="getUserListByUserNameOrLoginName" resultMap="com.zsw.erp.datasource.mappers.UserMapper.BaseResultMap">
select user.id, user.username, user.login_name, 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>
<if test="loginName != null and loginName != ''">
and user.login_name = #{loginName}
</if>
order by user.id desc
</select>
<update id="batDeleteOrUpdateUser">
update jsh_user
set status=#{status}
where id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
<resultMap id="BaseTreeResultMap" type="com.zsw.erp.datasource.vo.TreeNodeEx">
<result column="id" property="id"/>
<result column="text" property="text"/>
<association property="attributes" javaType="com.zsw.erp.datasource.vo.NodeAttributes">
<id column="orgNo" property="no"></id>
<result column="type" property="type"></result>
</association>
<collection column="{orgId=id,orgNo=orgNo}" property="children" javaType="java.util.ArrayList"
ofType="com.zsw.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
<resultMap id="NextTreeResultMap" type="com.zsw.erp.datasource.vo.TreeNodeEx">
<result column="id" property="id"/>
<result column="text" property="text"/>
<result column="iconCls" property="iconCls"/>
<association property="attributes" javaType="com.zsw.erp.datasource.vo.NodeAttributes">
<id column="orgNo" property="no"></id>
<result column="type" property="type"></result>
</association>
<collection column="{orgId=id,orgNo=orgNo}" property="children" javaType="java.util.ArrayList"
ofType="com.zsw.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
select id , text,orgNo,sort ,iconCls,type from (
SELECT
org.id, org.org_abr as text,org.org_no as orgNo,org.sort as sort,null as iconCls,'0' as type
FROM jsh_organization org
WHERE org.org_parent_no = #{orgNo}
and ifnull(org.org_stcd,'0') !='5'
union all
select
user.id,user.username as text, null as orgNo,rel.user_blng_orga_dspl_seq as sort,'icon-user' as iconCls,'1' as type
from jsh_user user,jsh_orga_user_rel rel
where
1=1
and user.id=rel.user_id
and rel.orga_id=#{orgId}
and ifnull(rel.delete_flag,'0') !='1'
and ifnull(user.status,'0') not in('1','2')
) node
order by sort asc
</select>
<select id="getNodeTree" resultMap="BaseTreeResultMap">
SELECT
id, org_abr as text,org_no as orgNo,'0' as type
FROM jsh_organization
WHERE org_parent_no = -1
and ifnull(org_stcd,'0') !='5'
order by sort asc
</select>
</mapper>