Commit 1ff0eede authored by Mr.Tang's avatar Mr.Tang

人事管理-人数统计bug修复

parent bd5bce82
...@@ -188,4 +188,19 @@ public class EmploymentApprovalController extends BaseController ...@@ -188,4 +188,19 @@ public class EmploymentApprovalController extends BaseController
{ {
return AjaxResult.success(employmentApprovalService.getCurrentUserApproval()); return AjaxResult.success(employmentApprovalService.getCurrentUserApproval());
} }
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('common')")
@GetMapping("/getTodayBirthdayCount")
public AjaxResult getTodayBirthdayCount()
{
return AjaxResult.success(employmentApprovalService.countTodayBirthday());
}
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('common')")
@GetMapping("/getQuarterBirthdayCount")
public AjaxResult getQuarterBirthdayCount()
{
return AjaxResult.success(employmentApprovalService.countCurrentQuarterBirthday());
}
} }
...@@ -94,4 +94,9 @@ public interface EmploymentApprovalMapper ...@@ -94,4 +94,9 @@ public interface EmploymentApprovalMapper
public EmploymentApprovalDTO selectApprovalWithUser(Long userId); public EmploymentApprovalDTO selectApprovalWithUser(Long userId);
public Long countTodayBirthday();
public Long countCurrentQuarterBirthday();
} }
...@@ -87,4 +87,9 @@ public interface IEmploymentApprovalService ...@@ -87,4 +87,9 @@ public interface IEmploymentApprovalService
public EmploymentApprovalDTO getCurrentUserApproval(); public EmploymentApprovalDTO getCurrentUserApproval();
public Long countTodayBirthday();
public Long countCurrentQuarterBirthday();
} }
...@@ -188,4 +188,13 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService ...@@ -188,4 +188,13 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService
return employmentApprovalMapper.selectApprovalWithUser(loginUser.getUserId()); return employmentApprovalMapper.selectApprovalWithUser(loginUser.getUserId());
} }
@Override
public Long countTodayBirthday() {
return employmentApprovalMapper.countTodayBirthday();
}
@Override
public Long countCurrentQuarterBirthday() {
return employmentApprovalMapper.countCurrentQuarterBirthday();
}
} }
...@@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="submissionTime != null">submission_time = #{submissionTime},</if> <if test="submissionTime != null">submission_time = #{submissionTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="processState != null">process_state = #{processState},</if> <if test="processState != null">process_state = #{processState},</if>
<if test="currentNode != null">current_node = #{currentNode},</if> current_node = 101,
<if test="currentResponsiblePerson != null">current_responsible_person = #{currentResponsiblePerson},</if> <if test="currentResponsiblePerson != null">current_responsible_person = #{currentResponsiblePerson},</if>
<if test="isBorrowCompanyAssets != null">is_borrow_company_assets = #{isBorrowCompanyAssets},</if> <if test="isBorrowCompanyAssets != null">is_borrow_company_assets = #{isBorrowCompanyAssets},</if>
<if test="assetsName != null">assets_name = #{assetsName},</if> <if test="assetsName != null">assets_name = #{assetsName},</if>
...@@ -622,4 +622,129 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -622,4 +622,129 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE a.user_id = #{userId} WHERE a.user_id = #{userId}
</select> </select>
<select id="countTodayBirthday" resultType="Long">
SELECT COUNT(*) FROM employment_approval
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
<if test="gender != null "> and gender = #{gender}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="homeType != null "> and home_type = #{homeType}</if>
<if test="nativePlace != null and nativePlace != ''"> and native_place = #{nativePlace}</if>
<if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if>
<if test="homeAddress != null and homeAddress != ''"> and home_address = #{homeAddress}</if>
<if test="permanentAddress != null and permanentAddress != ''"> and permanent_address = #{permanentAddress}</if>
<if test="politicalOutlook != null "> and political_outlook = #{politicalOutlook}</if>
<if test="maritalStatus != null "> and marital_status = #{maritalStatus}</if>
<if test="workDate != null "> and work_date = #{workDate}</if>
<if test="workerPic != null and workerPic != ''"> and worker_pic = #{workerPic}</if>
<if test="emergencyContactName != null and emergencyContactName != ''"> and emergency_contact_name like concat('%', #{emergencyContactName}, '%')</if>
<if test="emergencyContactPhone != null and emergencyContactPhone != ''"> and emergency_contact_phone = #{emergencyContactPhone}</if>
<if test="emergencyContactRelation != null "> and emergency_contact_relation = #{emergencyContactRelation}</if>
<if test="insuredCity != null and insuredCity != ''"> and insured_city = #{insuredCity}</if>
<if test="socialSecurityAccount != null and socialSecurityAccount != ''"> and social_security_account = #{socialSecurityAccount}</if>
<if test="housingFundAccount != null and housingFundAccount != ''"> and housing_fund_account = #{housingFundAccount}</if>
<if test="bankAccount != null and bankAccount != ''"> and bank_account = #{bankAccount}</if>
<if test="openingBank != null and openingBank != ''"> and opening_bank = #{openingBank}</if>
<if test="serviceDate != null "> and service_date = #{serviceDate}</if>
<if test="serviceDepart != null "> and service_depart = #{serviceDepart}</if>
<if test="position != null "> and position = #{position}</if>
<if test="employmentForm != null "> and employment_form = #{employmentForm}</if>
<if test="formalSalary != null "> and formal_salary = #{formalSalary}</if>
<if test="employeeState != null "> and employee_state = #{employeeState}</if>
<if test="isTrialPeriod != null "> and is_trial_period = #{isTrialPeriod}</if>
<if test="trialPeriodSalary != null "> and trial_period_salary = #{trialPeriodSalary}</if>
<if test="trialPeriodDay != null "> and trial_period_day = #{trialPeriodDay}</if>
<if test="dateOfConfirmation != null "> and date_of_confirmation = #{dateOfConfirmation}</if>
<if test="educationLevel != null "> and education_level = #{educationLevel}</if>
<if test="diplomaPic != null and diplomaPic != ''"> and diploma_pic = #{diplomaPic}</if>
<if test="degreePic != null and degreePic != ''"> and degree_pic = #{degreePic}</if>
<if test="otherCertification != null and otherCertification != ''"> and other_certification = #{otherCertification}</if>
<if test="signature != null and signature != ''"> and signature = #{signature}</if>
<if test="applicationTime != null "> and application_time = #{applicationTime}</if>
<if test="managerOpinion != null "> and manager_opinion = #{managerOpinion}</if>
<if test="approvalTime != null "> and approval_time = #{approvalTime}</if>
<if test="managerSignature != null and managerSignature != ''"> and manager_signature = #{managerSignature}</if>
<if test="submitter != null and submitter != ''"> and submitter = #{submitter}</if>
<if test="submissionTime != null "> and submission_time = #{submissionTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="processState != null and processState != ''"> and process_state = #{processState}</if>
and current_node = 103
<if test="currentResponsiblePerson != null and currentResponsiblePerson != ''"> and current_responsible_person = #{currentResponsiblePerson}</if>
<if test="isBorrowCompanyAssets != null and isBorrowCompanyAssets != ''"> and is_borrow_company_assets = #{isBorrowCompanyAssets}</if>
<if test="assetsName != null and assetsName != ''"> and assets_name = #{assetsName}</if>
<if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if>
and employment_approval_state = 2
and is_draft = 1
<if test="empId != null and empId != ''"> and emp_id = #{empId}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
AND MONTH(birthday) = MONTH(CURDATE())
AND DAY(birthday) = DAY(CURDATE())
</where>
</select>
<select id="countCurrentQuarterBirthday" resultType="Long">
SELECT COUNT(*) FROM employment_approval
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
<if test="gender != null "> and gender = #{gender}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="homeType != null "> and home_type = #{homeType}</if>
<if test="nativePlace != null and nativePlace != ''"> and native_place = #{nativePlace}</if>
<if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if>
<if test="homeAddress != null and homeAddress != ''"> and home_address = #{homeAddress}</if>
<if test="permanentAddress != null and permanentAddress != ''"> and permanent_address = #{permanentAddress}</if>
<if test="politicalOutlook != null "> and political_outlook = #{politicalOutlook}</if>
<if test="maritalStatus != null "> and marital_status = #{maritalStatus}</if>
<if test="workDate != null "> and work_date = #{workDate}</if>
<if test="workerPic != null and workerPic != ''"> and worker_pic = #{workerPic}</if>
<if test="emergencyContactName != null and emergencyContactName != ''"> and emergency_contact_name like concat('%', #{emergencyContactName}, '%')</if>
<if test="emergencyContactPhone != null and emergencyContactPhone != ''"> and emergency_contact_phone = #{emergencyContactPhone}</if>
<if test="emergencyContactRelation != null "> and emergency_contact_relation = #{emergencyContactRelation}</if>
<if test="insuredCity != null and insuredCity != ''"> and insured_city = #{insuredCity}</if>
<if test="socialSecurityAccount != null and socialSecurityAccount != ''"> and social_security_account = #{socialSecurityAccount}</if>
<if test="housingFundAccount != null and housingFundAccount != ''"> and housing_fund_account = #{housingFundAccount}</if>
<if test="bankAccount != null and bankAccount != ''"> and bank_account = #{bankAccount}</if>
<if test="openingBank != null and openingBank != ''"> and opening_bank = #{openingBank}</if>
<if test="serviceDate != null "> and service_date = #{serviceDate}</if>
<if test="serviceDepart != null "> and service_depart = #{serviceDepart}</if>
<if test="position != null "> and position = #{position}</if>
<if test="employmentForm != null "> and employment_form = #{employmentForm}</if>
<if test="formalSalary != null "> and formal_salary = #{formalSalary}</if>
<if test="employeeState != null "> and employee_state = #{employeeState}</if>
<if test="isTrialPeriod != null "> and is_trial_period = #{isTrialPeriod}</if>
<if test="trialPeriodSalary != null "> and trial_period_salary = #{trialPeriodSalary}</if>
<if test="trialPeriodDay != null "> and trial_period_day = #{trialPeriodDay}</if>
<if test="dateOfConfirmation != null "> and date_of_confirmation = #{dateOfConfirmation}</if>
<if test="educationLevel != null "> and education_level = #{educationLevel}</if>
<if test="diplomaPic != null and diplomaPic != ''"> and diploma_pic = #{diplomaPic}</if>
<if test="degreePic != null and degreePic != ''"> and degree_pic = #{degreePic}</if>
<if test="otherCertification != null and otherCertification != ''"> and other_certification = #{otherCertification}</if>
<if test="signature != null and signature != ''"> and signature = #{signature}</if>
<if test="applicationTime != null "> and application_time = #{applicationTime}</if>
<if test="managerOpinion != null "> and manager_opinion = #{managerOpinion}</if>
<if test="approvalTime != null "> and approval_time = #{approvalTime}</if>
<if test="managerSignature != null and managerSignature != ''"> and manager_signature = #{managerSignature}</if>
<if test="submitter != null and submitter != ''"> and submitter = #{submitter}</if>
<if test="submissionTime != null "> and submission_time = #{submissionTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="processState != null and processState != ''"> and process_state = #{processState}</if>
and current_node = 103
<if test="currentResponsiblePerson != null and currentResponsiblePerson != ''"> and current_responsible_person = #{currentResponsiblePerson}</if>
<if test="isBorrowCompanyAssets != null and isBorrowCompanyAssets != ''"> and is_borrow_company_assets = #{isBorrowCompanyAssets}</if>
<if test="assetsName != null and assetsName != ''"> and assets_name = #{assetsName}</if>
<if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if>
and employment_approval_state = 2
and is_draft = 1
<if test="empId != null and empId != ''"> and emp_id = #{empId}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
AND QUARTER(birthday) = QUARTER(CURDATE())
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
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