|
|
@@ -177,17 +177,17 @@
|
|
|
|
|
|
<!-- 获取组织部门 -->
|
|
|
<select id="getOrg" resultType="java.util.Map">
|
|
|
- select org_Id AS "orgId",
|
|
|
- org_code AS "orgCode",
|
|
|
- org_name AS "orgName",
|
|
|
- org_Id AS "id",
|
|
|
- parent_id AS "parentId",
|
|
|
- top_Id AS "topId",
|
|
|
- display_no AS "displayNo",
|
|
|
- remarks
|
|
|
- from core.t_organization
|
|
|
- where fty_id = #{ftyId}
|
|
|
- and flg_valid
|
|
|
+ select org_Id AS "orgId",
|
|
|
+ org_code AS "orgCode",
|
|
|
+ org_name AS "orgName",
|
|
|
+ org_Id AS "id",
|
|
|
+ parent_id AS "parentId",
|
|
|
+ top_Id AS "topId",
|
|
|
+ display_no AS "displayNo",
|
|
|
+ remarks
|
|
|
+ from dkic_b.t_mst_org
|
|
|
+ where flg_valid
|
|
|
+ and cp_id = #{cpId}
|
|
|
<if test="topId != null">
|
|
|
AND top_id = #{topId}
|
|
|
</if>
|
|
|
@@ -196,6 +196,22 @@
|
|
|
</if>
|
|
|
order by display_no
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- t_mst_org,(条件查询)个数 -->
|
|
|
+ <select id="getOrgCountByPage" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ from dkic_b.t_mst_org
|
|
|
+ where flg_valid
|
|
|
+ and cp_id = #{cpId}
|
|
|
+ <if test="topId != null">
|
|
|
+ AND top_id = #{topId}
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">
|
|
|
+ AND org_id != #{orgId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 产品品牌-->
|
|
|
<select id="getBrand" resultType="java.util.Map">
|
|
|
select brand_id as "brandId",
|
|
|
@@ -272,47 +288,20 @@
|
|
|
|
|
|
<!-- 获取员工 -->
|
|
|
<select id="getStaffByPage" resultType="java.util.Map">
|
|
|
- select staff.staff_id AS "staffId",
|
|
|
- staff.staff_code AS "staffCode",
|
|
|
- staff.staff_name AS "staffName",
|
|
|
- sys.f_code_name(staff.staff_code,staff.staff_name) AS "staffCodeName",
|
|
|
- staff.job_id AS "jobId",
|
|
|
- org.level_name AS "orgName",
|
|
|
- post.post_name AS "postName",
|
|
|
- job.job_name AS "jobName",
|
|
|
- staff.remarks
|
|
|
- from core.t_staff AS staff
|
|
|
- left join core.t_organization AS org
|
|
|
- on staff.org_id = org.org_id
|
|
|
- left join core.t_post AS post
|
|
|
- on staff.post_id = post.post_id
|
|
|
- left join core.t_job AS job
|
|
|
- on staff.job_id = job.job_id
|
|
|
- where staff.fty_id = #{ftyId}
|
|
|
- and staff.flg_valid
|
|
|
- and staff.staff_status = '员工状态-在职'
|
|
|
- <if test="jobName != null and jobName != ''">
|
|
|
- And position (#{jobName} in job.job_name)>0
|
|
|
- </if>
|
|
|
+ select staff.staff_id AS "staffId",
|
|
|
+ staff.staff_code AS "staffCode",
|
|
|
+ staff.staff_name AS "staffName",
|
|
|
+ sys.f_code_name(staff.staff_code, staff.staff_name) AS "staffCodeName",
|
|
|
+ staff.remarks
|
|
|
+ from dkic_b.t_mst_staff AS staff
|
|
|
+ where staff.flg_valid
|
|
|
+ and staff.cp_id =#{cpId}
|
|
|
<if test="staffCode != null and staffCode != ''">
|
|
|
And position (#{staffCode} in staff.staff_code)>0
|
|
|
</if>
|
|
|
<if test="staffName != null and staffName != ''">
|
|
|
And position (#{staffName} in staff.staff_name)>0
|
|
|
</if>
|
|
|
- <if test="jobId != null and jobId != ''">
|
|
|
- And staff.job_id = #{jobId}
|
|
|
- </if>
|
|
|
- <if test="jobIds != null and jobIds.size() > 0">
|
|
|
- And staff.job_id =any(#{jobIds, typeHandler=BigIntListTypeHandler})
|
|
|
- </if>
|
|
|
- <if test="staffUserId != null and staffUserId != ''">
|
|
|
- And EXISTS(select 1 from core.t_work_team t where t.user_id = #{staffUserId}
|
|
|
- <if test="jobId != null and jobId != ''">
|
|
|
- And t.wt_job_id = #{jobId}
|
|
|
- </if>
|
|
|
- And staff.staff_id = any (t.staff_ids))
|
|
|
- </if>
|
|
|
order by staff.staff_code
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -323,38 +312,15 @@
|
|
|
<select id="getStaffCountByPage" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- from core.t_staff AS staff
|
|
|
- left join core.t_organization AS org
|
|
|
- on staff.org_id = org.org_id
|
|
|
- left join core.t_post AS post
|
|
|
- on staff.post_id = post.post_id
|
|
|
- left join core.t_job AS job
|
|
|
- on staff.job_id = job.job_id
|
|
|
- where staff.fty_id = #{ftyId}
|
|
|
- and staff.flg_valid
|
|
|
- and staff.staff_status = '员工状态-在职'
|
|
|
- <if test="jobName != null and jobName != ''">
|
|
|
- And position (#{jobName} in job.job_name)>0
|
|
|
- </if>
|
|
|
+ from dkic_b.t_mst_staff AS staff
|
|
|
+ where staff.flg_valid
|
|
|
+ and staff.cp_id =#{cpId}
|
|
|
<if test="staffCode != null and staffCode != ''">
|
|
|
And position (#{staffCode} in staff.staff_code)>0
|
|
|
</if>
|
|
|
<if test="staffName != null and staffName != ''">
|
|
|
And position (#{staffName} in staff.staff_name)>0
|
|
|
</if>
|
|
|
- <if test="jobId != null and jobId != ''">
|
|
|
- And staff.job_id = #{jobId}
|
|
|
- </if>
|
|
|
- <if test="jobIds != null and jobIds.size() > 0">
|
|
|
- And staff.job_id =any(#{jobIds, typeHandler=BigIntListTypeHandler})
|
|
|
- </if>
|
|
|
- <if test="staffUserId != null and staffUserId != ''">
|
|
|
- And EXISTS(select 1 from core.t_work_team t where t.user_id = #{staffUserId}
|
|
|
- <if test="jobId != null and jobId != ''">
|
|
|
- And t.wt_job_id = #{jobId}
|
|
|
- </if>
|
|
|
- And staff.staff_id = any (t.staff_ids))
|
|
|
- </if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 函数查询单个系统参数-->
|