step 5 : perbaikan list query

This commit is contained in:
sindhu
2024-05-30 09:58:27 +07:00
parent 42f8dd356d
commit 70c426588a
4 changed files with 117 additions and 63 deletions

View File

@@ -620,38 +620,12 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
querytotal := `
SELECT COUNT(*)
FROM m_doctor as d
-- join terminology religion
JOIN terminology as religion
ON d.M_DoctorReligionCode = religion.code
AND d.M_DoctorReligionSystem = religion.code_system
AND religion.status_cd = 'normal'
-- join terminology blood type
JOIN terminology as bloodType
ON d.M_DoctorBloodTypeCode = bloodType.code
AND d.M_DoctorBloodTypeSystem = bloodType.code_system
AND bloodType.status_cd = 'normal'
-- join terminology blood rhesus
JOIN terminology as bloodRh
ON d.M_DoctorBloodRhCode = bloodRh.code
AND d.M_DoctorBloodRhSystem = bloodRh.code_system
AND bloodRh.status_cd = 'normal'
-- join terminology education
JOIN terminology as education
ON d.M_DoctorEducationCode = education.code
AND d.M_DoctorEducationSystem = education.code_system
AND education.status_cd = 'normal'
-- join terminology ethnic
JOIN terminology as ethnic
ON d.M_DoctorEtnicCode = ethnic.code
AND d.M_DoctorEtnicSystem = ethnic.code_system
AND ethnic.status_cd = 'normal'
-- join terminology identifier
JOIN terminology as identifier
ON d.M_DoctorIdentifierCode = identifier.code
AND d.M_DoctorIdentifierSystem = identifier.code_system
AND identifier.status_cd = 'normal'
-- join m_title
LEFT JOIN m_title as title
ON d.M_DoctorM_TitleID = title.M_TitleID
AND title.M_TitleIsActive = 'Y'
-- join m_specialist
JOIN m_specialist as spesialis
LEFT JOIN m_specialist as spesialis
ON d.M_DoctorM_SpecialistID = spesialis.M_SpecialistID
AND spesialis.M_SpecialistIsActive = 'Y'
WHERE d.M_DoctorIsActive = 'Y' AND
@@ -713,6 +687,8 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
d.M_DoctorM_SpecialistID,
spesialis.M_SpecialistID,
spesialis.M_SpecialistName,
IFNULL(d.M_DoctorAddress, '') as M_DoctorAddress,
IFNULL(title.M_TitleName, '') as M_TitleName,
d.M_DoctorCreated,
d.M_DoctorCreatedUserID,
d.M_DoctorLastUpdated,
@@ -720,38 +696,12 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
d.M_DoctorDeletedUserID,
d.M_DoctorDeleted
FROM m_doctor as d
-- join terminology religion
JOIN terminology as religion
ON d.M_DoctorReligionCode = religion.code
AND d.M_DoctorReligionSystem = religion.code_system
AND religion.status_cd = 'normal'
-- join terminology blood type
JOIN terminology as bloodType
ON d.M_DoctorBloodTypeCode = bloodType.code
AND d.M_DoctorBloodTypeSystem = bloodType.code_system
AND bloodType.status_cd = 'normal'
-- join terminology blood rhesus
JOIN terminology as bloodRh
ON d.M_DoctorBloodRhCode = bloodRh.code
AND d.M_DoctorBloodRhSystem = bloodRh.code_system
AND bloodRh.status_cd = 'normal'
-- join terminology education
JOIN terminology as education
ON d.M_DoctorEducationCode = education.code
AND d.M_DoctorEducationSystem = education.code_system
AND education.status_cd = 'normal'
-- join terminology ethnic
JOIN terminology as ethnic
ON d.M_DoctorEtnicCode = ethnic.code
AND d.M_DoctorEtnicSystem = ethnic.code_system
AND ethnic.status_cd = 'normal'
-- join terminology identifier
JOIN terminology as identifier
ON d.M_DoctorIdentifierCode = identifier.code
AND d.M_DoctorIdentifierSystem = identifier.code_system
AND identifier.status_cd = 'normal'
-- join m_title
LEFT JOIN m_title as title
ON d.M_DoctorM_TitleID = title.M_TitleID
AND title.M_TitleIsActive = 'Y'
-- join m_specialist
JOIN m_specialist as spesialis
LEFT JOIN m_specialist as spesialis
ON d.M_DoctorM_SpecialistID = spesialis.M_SpecialistID
AND spesialis.M_SpecialistIsActive = 'Y'
WHERE d.M_DoctorIsActive = 'Y' AND