38 lines
1.6 KiB
XML
38 lines
1.6 KiB
XML
<?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" >
|
|
<mapper namespace="com.engine.salary.mapper.dzreport.DzSalaryReportMapper">
|
|
|
|
|
|
<select id="getReportList" resultType="com.engine.salary.entity.dzreport.dto.DzSalaryReportDTO">
|
|
select e.id as userId, record.salary_month as month,result.tax_agent_id
|
|
from hrsa_salary_acct_record record
|
|
inner join hrsa_salary_acct_result result on record.id = result.salary_acct_record_id and result.delete_type = 0
|
|
and record.delete_type = 0
|
|
inner join hrsa_salary_item item on result.salary_item_id = item.id and item.delete_type = 0
|
|
inner join hrmresource e on e.id= result.employee_id
|
|
inner join cus_fielddata cus on cus.id = e.id and cus.SCOPE ='HrmCustomFieldByInfoType' and cus.SCOPEID = -1
|
|
where 1=1
|
|
<if test=" month !=null ">
|
|
and record.salary_month = #{month}
|
|
</if>
|
|
<if test=" productGrouping !=null and productGrouping !='' ">
|
|
and cus.field21 = #{productGrouping}
|
|
</if>
|
|
|
|
<if test=" deptIds !=null and deptIds.size() > 0">
|
|
and e.departmentid in
|
|
<foreach collection="deptIds" open="(" item="id" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
group by result.tax_agent_id,e.id,record.salary_month
|
|
order by month desc ,userId
|
|
</select>
|
|
|
|
<select id="getTaxAgentName" resultType="java.lang.String">
|
|
SELECT
|
|
name
|
|
FROM hrsa_tax_agent t
|
|
WHERE id = #{id} AND delete_type = 0
|
|
</select>
|
|
</mapper> |