weaver-hrm-salary/src/com/engine/salary/mapper/InsuranceExportMapper.xml

117 lines
5.8 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.InsuranceExportMapper">
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
e.STATUS AS userStatus,
e.workcode AS workcode
FROM (
SELECT *
from hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{param.billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{param.paymentOrganization}
) a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
</if>
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
SELECT
a.*,e.lastname AS userName,e.MOBILE AS telephone,d.departmentname AS departmentName,e.STATUS AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
)a
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
</select>
</mapper>