ปรับปรุงหน้าจอ migration และ เงื่อนไขการค้นหา หน้าทำแบบประเมิน
This commit is contained in:
@@ -95,7 +95,8 @@ hpt.position_type_name,he.packing_date,he.cost_of_living,
|
||||
LIMIT 1) IS NOT null THEN 'ช่วยปฎิบัติหน้าที่'
|
||||
ELSE null END) as remark_hrm_work_record,
|
||||
|
||||
org_type_depart.department_degree_id, he.timerecorder_id
|
||||
org_type_depart.department_degree_id, he.timerecorder_id,
|
||||
(select count(*) from hrm_resigns where hrm_resigns.employee_id = he.employee_id) as count_resigns
|
||||
|
||||
from public.hrm_employees as he
|
||||
left join public.hrm_position_types as hpt on he.position_type_id=hpt.id
|
||||
@@ -108,6 +109,30 @@ left join public.hrm_employee_types as het on het.id = he.employee_type_id
|
||||
left join public.users as u on u.employee_id = he.employee_id
|
||||
left join public.org_type_departments as org_type_depart on orgdata.department_type_id = org_type_depart.id
|
||||
left join public.org_type_department_colors as org_depart_color on org_type_depart.department_degree_id = org_depart_color.id
|
||||
left join (select orgdata.id,orgdata2.id as id2,
|
||||
case when orgdata2.department_name is not null then
|
||||
concat(orgdata2.department_name,' - ',orgdata.department_name)
|
||||
else orgdata.department_name end as full_dep,
|
||||
orgdata.department_name,
|
||||
orgdata.department_code,detail.parent_department_id,
|
||||
case
|
||||
when org_type_depart.department_degree_id = 1 then orgdata.department_code::int*1000
|
||||
when detail.parent_department_id is not null and detail.parent_department_id>0
|
||||
then orgdata2.department_code::int*1000+orgdata.department_code::int
|
||||
else orgdata.department_code::int*100000 end as sort_order,org_type_depart.department_degree_id
|
||||
from public.{0}DepartmentData{0} orgdata
|
||||
left join org_organization_chart_details detail on orgdata.id = detail.department_id
|
||||
left join public.{0}DepartmentData{0} orgdata2 on orgdata2.id = detail.parent_department_id
|
||||
left join public.org_type_departments as org_type_depart on orgdata.department_type_id = org_type_depart.id
|
||||
left join public.org_type_department_colors as org_depart_color
|
||||
on org_type_depart.department_degree_id = org_depart_color.id
|
||||
where orgdata.department_name is not null
|
||||
order by case
|
||||
when org_type_depart.department_degree_id = 1 then orgdata.department_code::int*1000
|
||||
when detail.parent_department_id is not null and detail.parent_department_id>0
|
||||
then orgdata2.department_code::int*1000+orgdata.department_code::int
|
||||
else orgdata.department_code::int*100000 end) as sorting_dep
|
||||
on sorting_dep.id = he.department_id
|
||||
where he.deleted_at is null
|
||||
and hpt.deleted_at is null
|
||||
and hpl.deleted_at is null
|
||||
@@ -119,7 +144,7 @@ and het.deleted_at is null
|
||||
and u.deleted_at is null
|
||||
and org_type_depart.deleted_at is null
|
||||
and org_depart_color.deleted_at is null
|
||||
order by he.firstname, he.lastname;
|
||||
order by sorting_dep.sort_order, hpt.position_type_id, hpl.position_level_id, employee_no desc;
|
||||
", '"'.ToString());
|
||||
var para = db.GetParameterListNpgsql();
|
||||
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
|
||||
@@ -210,6 +235,14 @@ order by he.firstname, he.lastname;
|
||||
{
|
||||
i.timerecorder_id = "";
|
||||
}
|
||||
if (dr["count_resigns"] != DBNull.Value)
|
||||
{
|
||||
i.count_resigns = Convert.ToInt32(dr["count_resigns"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
i.count_resigns = 0;
|
||||
}
|
||||
|
||||
result.Add(i);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace TodoAPI2.Models
|
||||
public string profile_picture { get; set; }
|
||||
|
||||
public string timerecorder_id { get; set; }
|
||||
public int count_resigns { get; set; }
|
||||
|
||||
public int? worked_month // ทำงานมาแล้วกี่เดือน
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user