Commit 9d293256 by 墨竹

fix:员工查询判断空

parent b431904b
...@@ -120,6 +120,7 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -120,6 +120,7 @@ public class AuditApiServiceImpl implements AuditApiService {
} }
if (CollectionUtil.isNotEmpty(page.getResult())) { if (CollectionUtil.isNotEmpty(page.getResult())) {
List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList()); List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(commitStaffIds)) {
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds); List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId"); Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
for (TabHaobanAudit tab : page.getResult()) { for (TabHaobanAudit tab : page.getResult()) {
...@@ -128,6 +129,7 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -128,6 +129,7 @@ public class AuditApiServiceImpl implements AuditApiService {
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg()); tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
} }
} }
}
return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class); return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class);
} }
......
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.DepartmentMapper" > <mapper namespace="com.gic.haoban.manage.service.dao.mapper.DepartmentMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanDepartment">
<id column="department_id" property="departmentId" jdbcType="VARCHAR" /> <id column="department_id" property="departmentId" jdbcType="VARCHAR"/>
<result column="department_name" property="departmentName" jdbcType="VARCHAR" /> <result column="department_name" property="departmentName" jdbcType="VARCHAR"/>
<result column="parent_department_id" property="parentDepartmentId" jdbcType="VARCHAR" /> <result column="parent_department_id" property="parentDepartmentId" jdbcType="VARCHAR"/>
<result column="related_id" property="relatedId" jdbcType="VARCHAR" /> <result column="related_id" property="relatedId" jdbcType="VARCHAR"/>
<result column="related_code" property="relatedCode" jdbcType="VARCHAR" /> <result column="related_code" property="relatedCode" jdbcType="VARCHAR"/>
<result column="chain_id" property="chainId" jdbcType="VARCHAR" /> <result column="chain_id" property="chainId" jdbcType="VARCHAR"/>
<result column="chain_name" property="chainName" jdbcType="VARCHAR" /> <result column="chain_name" property="chainName" jdbcType="VARCHAR"/>
<result column="is_store" property="isStore" jdbcType="INTEGER" /> <result column="is_store" property="isStore" jdbcType="INTEGER"/>
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" /> <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
<result column="recycle_flag" property="recycleFlag" jdbcType="INTEGER" /> <result column="recycle_flag" property="recycleFlag" jdbcType="INTEGER"/>
<result column="gic_del_flag" property="gicDelFlag" jdbcType="INTEGER" /> <result column="gic_del_flag" property="gicDelFlag" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="wx_department_id" property="wxDepartmentId" jdbcType="VARCHAR" /> <result column="wx_department_id" property="wxDepartmentId" jdbcType="VARCHAR"/>
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" /> <result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR"/>
<result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR" /> <result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR"/>
<result column="sort" property="sort" jdbcType="BIGINT" /> <result column="sort" property="sort" jdbcType="BIGINT"/>
<result column="level" property="level" jdbcType="INTEGER" /> <result column="level" property="level" jdbcType="INTEGER"/>
<result column="temp_flag" property="tempFlag" jdbcType="INTEGER"/> <result column="temp_flag" property="tempFlag" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List">
department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store, department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store,
status_flag, recycle_flag, create_time, status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name,enterprise_id,gic_del_flag,temp_flag update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name,enterprise_id,gic_del_flag,temp_flag
</sql> </sql>
<sql id="Base_Column_List_short" > <sql id="Base_Column_List_short">
department_id, department_name, parent_department_id,wx_department_id,sort,level department_id, department_name, parent_department_id,wx_department_id,sort,level
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where department_id = #{departmentId,jdbcType=VARCHAR} where department_id = #{departmentId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" > <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_haoban_department delete
from tab_haoban_department
where department_id = #{departmentId,jdbcType=VARCHAR} where department_id = #{departmentId,jdbcType=VARCHAR}
</delete> </delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment">
insert into tab_haoban_department (department_id, department_name, parent_department_id, insert into tab_haoban_department (department_id, department_name, parent_department_id,
related_id,related_code, chain_id, is_store, related_id, related_code, chain_id, is_store,
status_flag, recycle_flag, create_time, status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name,enterprise_id,temp_flag) update_time, wx_department_id, sort, level, wx_enterprise_id, chain_name,
values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR}, enterprise_id, temp_flag)
#{relatedId,jdbcType=VARCHAR},#{relatedCode,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER}, values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR},
#{parentDepartmentId,jdbcType=VARCHAR},
#{relatedId,jdbcType=VARCHAR}, #{relatedCode,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR},
#{isStore,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId},#{chainName},#{enterpriseId},#{tempFlag}) #{updateTime,jdbcType=TIMESTAMP}, #{wxDepartmentId}, #{sort}, #{level}, #{wxEnterpriseId}, #{chainName},
#{enterpriseId}, #{tempFlag})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment">
insert into tab_haoban_department insert into tab_haoban_department
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="departmentId != null" > <if test="departmentId != null">
department_id, department_id,
</if> </if>
<if test="departmentName != null" > <if test="departmentName != null">
department_name, department_name,
</if> </if>
<if test="parentDepartmentId != null" > <if test="parentDepartmentId != null">
parent_department_id, parent_department_id,
</if> </if>
<if test="relatedId != null" > <if test="relatedId != null">
related_id, related_id,
</if> </if>
<if test="relatedCode != null" > <if test="relatedCode != null">
related_code, related_code,
</if> </if>
<if test="chainId != null" > <if test="chainId != null">
chain_id, chain_id,
</if> </if>
<if test="chainName != null" > <if test="chainName != null">
chain_name, chain_name,
</if> </if>
<if test="isStore != null" > <if test="isStore != null">
is_store, is_store,
</if> </if>
<if test="statusFlag != null" > <if test="statusFlag != null">
status_flag, status_flag,
</if> </if>
<if test="recycleFlag != null" > <if test="recycleFlag != null">
recycle_flag, recycle_flag,
</if> </if>
<if test="createTime != null" > <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="updateTime != null" > <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="wxDepartmentId != null" > <if test="wxDepartmentId != null">
wx_department_id, wx_department_id,
</if> </if>
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null">
wx_enterprise_id, wx_enterprise_id,
</if> </if>
<if test="enterpriseId != null" > <if test="enterpriseId != null">
enterprise_id, enterprise_id,
</if> </if>
<if test="sort != null" > <if test="sort != null">
sort, sort,
</if> </if>
<if test="level != null" > <if test="level != null">
level, level,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="departmentId != null" > <if test="departmentId != null">
#{departmentId,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
</if> </if>
<if test="departmentName != null" > <if test="departmentName != null">
#{departmentName,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR},
</if> </if>
<if test="parentDepartmentId != null" > <if test="parentDepartmentId != null">
#{parentDepartmentId,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedId != null" > <if test="relatedId != null">
#{relatedId,jdbcType=VARCHAR}, #{relatedId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedCode != null" > <if test="relatedCode != null">
#{relatedCode,jdbcType=VARCHAR}, #{relatedCode,jdbcType=VARCHAR},
</if> </if>
<if test="chainId != null" > <if test="chainId != null">
#{chainId,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR},
</if> </if>
<if test="chainName != null" > <if test="chainName != null">
#{chainName,jdbcType=VARCHAR}, #{chainName,jdbcType=VARCHAR},
</if> </if>
<if test="isStore != null" > <if test="isStore != null">
#{isStore,jdbcType=INTEGER}, #{isStore,jdbcType=INTEGER},
</if> </if>
<if test="statusFlag != null" > <if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
</if> </if>
<if test="recycleFlag != null" > <if test="recycleFlag != null">
#{recycleFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER},
</if> </if>
<if test="createTime != null" > <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="updateTime != null" > <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="wxDepartmentId != null" > <if test="wxDepartmentId != null">
#{wxDepartmentId}, #{wxDepartmentId},
</if> </if>
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null">
#{wxEnterpriseId}, #{wxEnterpriseId},
</if> </if>
<if test="enterpriseId != null" > <if test="enterpriseId != null">
#{enterpriseId}, #{enterpriseId},
</if> </if>
<if test="sort != null" > <if test="sort != null">
#{sort}, #{sort},
</if> </if>
<if test="level != null" > <if test="level != null">
#{level}, #{level},
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment">
update tab_haoban_department update tab_haoban_department
<set > <set>
<if test="departmentName != null" > <if test="departmentName != null">
department_name = #{departmentName,jdbcType=VARCHAR}, department_name = #{departmentName,jdbcType=VARCHAR},
</if> </if>
<if test="parentDepartmentId != null" > <if test="parentDepartmentId != null">
parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}, parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedId != null" > <if test="relatedId != null">
related_id = #{relatedId,jdbcType=VARCHAR}, related_id = #{relatedId,jdbcType=VARCHAR},
</if> </if>
<if test="relatedCode != null" > <if test="relatedCode != null">
related_code = #{relatedCode,jdbcType=VARCHAR}, related_code = #{relatedCode,jdbcType=VARCHAR},
</if> </if>
<if test="chainId != null" > <if test="chainId != null">
chain_id = #{chainId,jdbcType=VARCHAR}, chain_id = #{chainId,jdbcType=VARCHAR},
</if> </if>
<if test="chainName != null" > <if test="chainName != null">
chain_name = #{chainName,jdbcType=VARCHAR}, chain_name = #{chainName,jdbcType=VARCHAR},
</if> </if>
<if test="isStore != null" > <if test="isStore != null">
is_store = #{isStore,jdbcType=INTEGER}, is_store = #{isStore,jdbcType=INTEGER},
</if> </if>
<if test="statusFlag != null" > <if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER}, status_flag = #{statusFlag,jdbcType=INTEGER},
</if> </if>
<if test="recycleFlag != null" > <if test="recycleFlag != null">
recycle_flag = #{recycleFlag,jdbcType=INTEGER}, recycle_flag = #{recycleFlag,jdbcType=INTEGER},
</if> </if>
<if test="createTime != null" > <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="updateTime != null" > <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="wxDepartmentId != null" > <if test="wxDepartmentId != null">
wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR}, wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR},
</if> </if>
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null">
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}, wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if> </if>
<if test="enterpriseId != null" > <if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=VARCHAR}, enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if> </if>
<if test="sort != null" > <if test="sort != null">
sort = #{sort}, sort = #{sort},
</if> </if>
<if test="level != null" > <if test="level != null">
level = #{level,jdbcType=INTEGER}, level = #{level,jdbcType=INTEGER},
</if> </if>
<if test="gicDelFlag != null" > <if test="gicDelFlag != null">
gic_del_flag = #{gicDelFlag,jdbcType=INTEGER}, gic_del_flag = #{gicDelFlag,jdbcType=INTEGER},
</if> </if>
</set> </set>
where department_id = #{departmentId,jdbcType=VARCHAR} where department_id = #{departmentId,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment" > <update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanDepartment">
update tab_haoban_department update tab_haoban_department
set department_name = #{departmentName,jdbcType=VARCHAR}, set department_name = #{departmentName,jdbcType=VARCHAR},
parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}, parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR},
...@@ -242,9 +247,9 @@ ...@@ -242,9 +247,9 @@
where department_id = #{departmentId,jdbcType=VARCHAR} where department_id = #{departmentId,jdbcType=VARCHAR}
</update> </update>
<select id="listByParentId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listByParentId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where parent_department_id = #{parentId,jdbcType=VARCHAR} where parent_department_id = #{parentId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
...@@ -252,49 +257,49 @@ ...@@ -252,49 +257,49 @@
order by sort desc order by sort desc
</select> </select>
<select id="listDepartmentLikeName" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listDepartmentLikeName" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where department_name like CONCAT('%',#{departmentName,jdbcType=VARCHAR},'%') where department_name like CONCAT('%',#{departmentName,jdbcType=VARCHAR},'%')
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="selectMaxSort" resultType="java.lang.Long" parameterType="java.lang.String" > <select id="selectMaxSort" resultType="java.lang.Long" parameterType="java.lang.String">
select select ifnull(max(sort), 0)
ifnull(max(sort),0)
from tab_haoban_department from tab_haoban_department
where parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR} where parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="selectByRelatedId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByRelatedId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where related_id = #{relatedId,jdbcType=VARCHAR} where related_id = #{relatedId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="getByWxId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getByWxId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR} where wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="pageDepartmentByParams" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="pageDepartmentByParams" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
<if test="wxEnterpriseId != null and wxEnterpriseId != ''"> <if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
</if> </if>
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and (department_name like CONCAT('%',#{keyword},'%') or wx_department_id like CONCAT('%',#{keyword},'%') or related_code like CONCAT('%',#{keyword},'%')) and (department_name like CONCAT('%',#{keyword},'%') or wx_department_id like CONCAT('%',#{keyword},'%') or
related_code like CONCAT('%',#{keyword},'%'))
</if> </if>
<if test="recycleFlag != null"> <if test="recycleFlag != null">
and recycle_flag = #{recycleFlag} and recycle_flag = #{recycleFlag}
...@@ -305,9 +310,9 @@ ...@@ -305,9 +310,9 @@
order by sort desc order by sort desc
</select> </select>
<select id="listByDepartmentIds" resultMap="BaseResultMap" > <select id="listByDepartmentIds" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
<if test="storeFlag != null"> <if test="storeFlag != null">
...@@ -321,9 +326,9 @@ ...@@ -321,9 +326,9 @@
</if> </if>
order by sort desc order by sort desc
</select> </select>
<select id="listByRelatedIds" resultMap="BaseResultMap" > <select id="listByRelatedIds" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
and is_store = 1 and is_store = 1
...@@ -336,9 +341,9 @@ ...@@ -336,9 +341,9 @@
order by sort desc order by sort desc
</select> </select>
<select id="listStoreByWxEnterpriseId" resultMap="BaseResultMap" > <select id="listStoreByWxEnterpriseId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
and is_store = 1 and is_store = 1
...@@ -346,22 +351,22 @@ ...@@ -346,22 +351,22 @@
order by create_time order by create_time
</select> </select>
<select id="getRootByEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getRootByEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where level = 1 where level = 1
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="pageFullStoreByWxEnterpriseId" resultMap="BaseResultMap" > <select id="pageFullStoreByWxEnterpriseId" resultMap="BaseResultMap">
SELECT SELECT
t.* t.*
FROM FROM
( (
select select
@rownum := @rownum + 1 AS rownum, @rownum := @rownum + 1 AS rownum,
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department, from tab_haoban_department,
(SELECT(@rowNum := 0)) b (SELECT(@rowNum := 0)) b
where status_flag = 1 where status_flag = 1
...@@ -379,14 +384,14 @@ ...@@ -379,14 +384,14 @@
order by create_time order by create_time
) t WHERE t.rownum > #{minCount} ) t WHERE t.rownum > #{minCount}
</select> </select>
<select id="pageFullStoreByWxEnterpriseId2" resultMap="BaseResultMap" > <select id="pageFullStoreByWxEnterpriseId2" resultMap="BaseResultMap">
SELECT SELECT
t.* t.*
FROM FROM
( (
select select
@rownum := @rownum + 1 AS rownum, @rownum := @rownum + 1 AS rownum,
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department, from tab_haoban_department,
(SELECT(@rowNum := 0)) b (SELECT(@rowNum := 0)) b
where status_flag = 1 where status_flag = 1
...@@ -402,17 +407,17 @@ ...@@ -402,17 +407,17 @@
) t WHERE t.rownum > #{minCount} ) t WHERE t.rownum > #{minCount}
</select> </select>
<select id="getByRelatedId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getByRelatedId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where related_id = #{relatedId} where related_id = #{relatedId}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="getByRelatedIdNotInRecycle" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getByRelatedIdNotInRecycle" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where related_id = #{relatedId} where related_id = #{relatedId}
and status_flag = 1 and status_flag = 1
...@@ -420,9 +425,9 @@ ...@@ -420,9 +425,9 @@
</select> </select>
<select id="pageByParentId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="pageByParentId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
and recycle_flag != 1 and recycle_flag != 1
...@@ -436,53 +441,48 @@ ...@@ -436,53 +441,48 @@
</select> </select>
<select id="listByChainId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listByChainId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and chain_id like CONCAT(#{chainId},'%') and chain_id like CONCAT(#{chainId},'%')
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="departmentRecycleCount" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="departmentRecycleCount" resultType="java.lang.Integer" parameterType="java.lang.String">
select select count(1)
count(1)
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 and status_flag = 1
and recycle_flag = 1 and recycle_flag = 1
</select> </select>
<select id="countSyncDepartmentByEnterpriseId" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="countSyncDepartmentByEnterpriseId" resultType="java.lang.Integer" parameterType="java.lang.String">
select select count(1)
count(1)
from tab_haoban_department from tab_haoban_department
where enterprise_id = #{enterpriseId} where enterprise_id = #{enterpriseId}
and status_flag = 1 and status_flag = 1
and gic_del_flag is null and gic_del_flag is null
</select> </select>
<select id="countByDepartment" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="countByDepartment" resultType="java.lang.Integer" parameterType="java.lang.String">
select select count(1)
count(1)
from tab_haoban_department from tab_haoban_department
where parent_department_id = #{departmentId} where parent_department_id = #{departmentId}
and status_flag = 1 and status_flag = 1
and recycle_flag != 1 and recycle_flag != 1
</select> </select>
<select id="listByIds" resultMap="BaseResultMap" > <select id="listByIds" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
<if test="departmentIds != null and departmentIds.size() > 0">
and department_id IN and department_id IN
<foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
</if>
order by sort desc order by sort desc
</select> </select>
...@@ -496,9 +496,8 @@ ...@@ -496,9 +496,8 @@
and temp_flag = 1 and temp_flag = 1
</select> </select>
<select id="totalStoreCountByEnterpriseId" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="totalStoreCountByEnterpriseId" resultType="java.lang.Integer" parameterType="java.lang.String">
select select count(1)
count(1)
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 and status_flag = 1
...@@ -506,7 +505,7 @@ ...@@ -506,7 +505,7 @@
and is_store = 1 and is_store = 1
</select> </select>
<update id="cleanDepartment" > <update id="cleanDepartment">
update tab_haoban_department update tab_haoban_department
set set
status_flag = 0, status_flag = 0,
...@@ -518,9 +517,9 @@ ...@@ -518,9 +517,9 @@
</foreach> </foreach>
</update> </update>
<select id="listDepartmentByWxDepartIds" resultMap="BaseResultMap" > <select id="listDepartmentByWxDepartIds" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 and where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 and
wx_department_id in wx_department_id in
...@@ -529,17 +528,17 @@ ...@@ -529,17 +528,17 @@
</foreach> </foreach>
</select> </select>
<select id="listAllDepartment" resultMap="BaseResultMap" > <select id="listAllDepartment" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List_short" /> <include refid="Base_Column_List_short"/>
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
order by sort desc order by sort desc
</select> </select>
<select id="searchDepartment" resultMap="BaseResultMap" > <select id="searchDepartment" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List_short" /> <include refid="Base_Column_List_short"/>
from tab_haoban_department from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
and department_name likelike CONCAT('%',#{search},'%') and department_name likelike CONCAT('%',#{search},'%')
......
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
<update id="delOtherStaffByWxUserId"> <update id="delOtherStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
...@@ -295,12 +296,10 @@ ...@@ -295,12 +296,10 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_staff from tab_haoban_staff
where status_flag = 1 where status_flag = 1
<if test="staffIds != null and staffIds.size() > 0">
and staff_id IN and staff_id IN
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
</if>
</select> </select>
<select id="listByWxUserId" resultMap="BaseResultMap"> <select id="listByWxUserId" resultMap="BaseResultMap">
select select
...@@ -344,12 +343,10 @@ ...@@ -344,12 +343,10 @@
from tab_haoban_staff from tab_haoban_staff
where status_flag = 1 where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
<if test="userIds != null and userIds.size() > 0">
and wx_user_id IN and wx_user_id IN
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
</if>
</select> </select>
<update id="cleanStaff" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff"> <update id="cleanStaff" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
...@@ -473,7 +470,8 @@ ...@@ -473,7 +470,8 @@
<update id="delStaffByWxUserId"> <update id="delStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
...@@ -482,7 +480,8 @@ ...@@ -482,7 +480,8 @@
<update id="delStaffByPhoneNumber"> <update id="delStaffByPhoneNumber">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and phone_number = #{phoneNumber} and phone_number = #{phoneNumber}
and status_flag = 1 and status_flag = 1
......
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