<?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.salaryacct.SalaryAcctEmployeeMapper">
    <resultMap id="SalaryAccEmployeeMap"
               type="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
        <id column="id" property="id"/>
        <result column="salary_acct_record_id" property="salaryAcctRecordId"/>
        <result column="salary_sob_id" property="salarySobId"/>
        <result column="employee_id" property="employeeId"/>
        <result column="tax_agent_id" property="taxAgentId"/>
        <result column="salary_month" property="salaryMonth"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="creator" property="creator"/>
        <result column="delete_type" property="deleteType"/>
        <result column="tenant_key" property="tenantKey"/>
        <result column="employee_type" property="employeeType"/>
        <result column="lock_status" property="lockStatus"/>
        <result column="subcompany_name" property="subcompanyName"/>
        <result column="subcompany_id" property="subcompanyId"/>
        <result column="department_name" property="departmentName"/>
        <result column="department_id" property="departmentId"/>
        <result column="jobtitle_name" property="jobtitleName"/>
        <result column="jobtitle_id" property="jobtitleId"/>
        <result column="jobcall" property="jobcall"/>
        <result column="jobcall_id" property="jobcallId"/>
        <result column="status" property="status"/>
        <result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
        <result column="account_type" property="accountType"/>
    </resultMap>

    <resultMap id="SalaryAccEmployeeCountMap"
               type="com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO">
        <id column="salary_acct_record_id" property="salaryAcctRecordId"/>
        <result column="cnt" property="countBySalaryAcctRecordId"/>
    </resultMap>

    <sql id="SalaryAccEmployeeColumn">
        t
        .
        id
        ,
        t.salary_acct_record_id,
        t.salary_sob_id,
        t.employee_id,
        t.tax_agent_id,
        t.salary_month,
        t.creator,
        t.create_time,
        t.update_time,
        t.delete_type,
        t.tenant_key,
        t.employee_type,
        t.lock_status,
        t.subcompany_name,
        t.subcompany_id,
        t.department_name,
        t.department_id,
        t.jobtitle_name,
        t.jobtitle_id,
        t.jobcall,
        t.jobcall_id,
        t.status,
        t.lock_items,
        t.account_type
    </sql>

    <sql id="emp1Column">
        emp1
        .
        id
        , emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
        emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type
    </sql>

    <insert id="batchInsert">
        INSERT INTO hrsa_salary_acct_emp(
        salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
        subcompany_name,
        subcompany_id,
        department_name,
        department_id,
        jobtitle_name,
        jobtitle_id,
        jobcall,
        jobcall_id,
        status,
        account_type)
        VALUES
        <foreach collection="collection" item="emp" separator=",">
            (
            #{emp.salaryAcctRecordId},
            #{emp.salarySobId},
            #{emp.employeeId},
            #{emp.taxAgentId},
            #{emp.salaryMonth},
            #{emp.creator},
            #{emp.createTime},
            #{emp.updateTime},
            #{emp.deleteType},
            #{emp.tenantKey},
            #{emp.employeeType},
            #{emp.lockStatus},
            #{emp.subcompanyName},
            #{emp.subcompanyId},
            #{emp.departmentName},
            #{emp.departmentId},
            #{emp.jobtitleName},
            #{emp.jobtitleId},
            #{emp.jobcall},
            #{emp.jobcallId},
            #{emp.status},
            #{emp.accountType}
            )
        </foreach>
    </insert>
    <insert id="batchInsert" databaseId="oracle">
        INSERT INTO hrsa_salary_acct_emp(
        salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
        subcompany_name,
        subcompany_id,
        department_name,
        department_id,
        jobtitle_name,
        jobtitle_id,
        jobcall,
        jobcall_id,
        status,
        account_type
        )
        <foreach collection="collection" item="emp" separator="union all">
            select
            #{emp.salaryAcctRecordId,jdbcType=DOUBLE},
            #{emp.salarySobId,jdbcType=DOUBLE},
            #{emp.employeeId,jdbcType=DOUBLE},
            #{emp.taxAgentId,jdbcType=DOUBLE},
            #{emp.salaryMonth,jdbcType=DATE},
            #{emp.creator,jdbcType=DOUBLE},
            #{emp.createTime,jdbcType=DATE},
            #{emp.updateTime,jdbcType=DATE},
            #{emp.deleteType,jdbcType=INTEGER},
            #{emp.tenantKey,jdbcType=VARCHAR},
            #{emp.employeeType,jdbcType=INTEGER},
            #{emp.lockStatus,jdbcType=INTEGER},
            #{emp.subcompanyName,jdbcType=VARCHAR},
            #{emp.subcompanyId,jdbcType=DOUBLE},
            #{emp.departmentName,jdbcType=VARCHAR},
            #{emp.departmentId,jdbcType=DOUBLE},
            #{emp.jobtitleName,jdbcType=VARCHAR},
            #{emp.jobtitleId,jdbcType=DOUBLE},
            #{emp.jobcall,jdbcType=VARCHAR},
            #{emp.jobcallId,jdbcType=DOUBLE},
            #{emp.status,jdbcType=VARCHAR},
            #{emp.accountType,jdbcType=INTEGER}
            from dual
        </foreach>
    </insert>
    <insert id="batchInsert" databaseId="sqlserver">
        <foreach collection="collection" item="emp" separator=";">
            INSERT INTO hrsa_salary_acct_emp(
            salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
            creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
            subcompany_name,
            subcompany_id,
            department_name,
            department_id,
            jobtitle_name,
            jobtitle_id,
            jobcall,
            jobcall_id,
            status,
            account_type
            )
            VALUES
            (
            #{emp.salaryAcctRecordId},
            #{emp.salarySobId},
            #{emp.employeeId},
            #{emp.taxAgentId},
            #{emp.salaryMonth},
            #{emp.creator},
            #{emp.createTime},
            #{emp.updateTime},
            #{emp.deleteType},
            #{emp.tenantKey},
            #{emp.employeeType},
            #{emp.lockStatus},
            #{emp.subcompanyName},
            #{emp.subcompanyId},
            #{emp.departmentName},
            #{emp.departmentId},
            #{emp.jobtitleName},
            #{emp.jobtitleId},
            #{emp.jobcall},
            #{emp.jobcallId},
            #{emp.status},
            #{emp.accountType}
            )
        </foreach>
    </insert>

    <select id="countGroupBySalaryAcctRecordId" resultMap="SalaryAccEmployeeCountMap">
        SELECT salary_acct_record_id, COUNT(*) cnt
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        GROUP BY salary_acct_record_id
    </select>

    <select id="listPage4ConsolidatedTax" resultMap="SalaryAccEmployeeMap">
        SELECT DISTINCT
        <include refid="emp1Column"/>
        FROM (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        ) emp1,
        (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>
    <select id="listPage4ConsolidatedTax" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT DISTINCT

        emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
        emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type

        FROM (
        SELECT

        id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key,employee_type

        FROM hrsa_salary_acct_emp
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}

        <if test="param.ids != null and param.ids.size()>0">
            AND id IN
            <foreach collection="param.ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="param.taxAgentId != null">
            AND tax_agent_id = #{param.taxAgentId}
        </if>
        <if test="(param.employeeName != null and param.employeeName != '')
            or (param.workcode != null and param.workcode != '')
            or (param.departmentIds != null and param.departmentIds.size()>0)
            or (param.positionIds != null and param.positionIds.size()>0)
            or (param.status != null and param.status.toString != 'ALL')">
            AND employee_id IN
            (
            SELECT id FROM hrmresource em WHERE em.status not in (7)
            <if test="param.employeeName != null and param.employeeName != ''">
                AND em.lastname LIKE '%'||#{param.employeeName}||'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND em.workcode like '%'||#{param.workcode}||'%'
            </if>
            <if test="param.departmentIds != null and param.departmentIds.size()>0">
                AND em.departmentid IN
                <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
                    #{departmentId}
                </foreach>
            </if>
            <if test="param.positionIds != null and param.positionIds.size()>0">
                AND em.jobtitle IN
                <foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
                    #{positionId}
                </foreach>
            </if>
            -- 在职
            <if test="param.status != null  and param.status.toString == 'NORMAL'">
                AND em.status in (0,1,2,3)
            </if>
            -- 离职
            <if test="param.status != null  and param.status.toString == 'UNAVAILABLE'">
                AND em.status in (4,5,6)
            </if>
            )
        </if>

        ) emp1,
        (
        SELECT

        id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key

        FROM hrsa_salary_acct_emp
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>
    <select id="listPage4ConsolidatedTax" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT DISTINCT

        emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
        emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type

        FROM (
        SELECT

        id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key,employee_type

        FROM hrsa_salary_acct_emp
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}

        <if test="param.ids != null and param.ids.size()>0">
            AND id IN
            <foreach collection="param.ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="param.taxAgentId != null">
            AND tax_agent_id = #{param.taxAgentId}
        </if>
        <if test="(param.employeeName != null and param.employeeName != '')
            or (param.workcode != null and param.workcode != '')
            or (param.departmentIds != null and param.departmentIds.size()>0)
            or (param.positionIds != null and param.positionIds.size()>0)
            or (param.status != null and param.status.toString != 'ALL')">
            AND employee_id IN
            (
            SELECT id FROM hrmresource em WHERE em.status not in (7)

            <if test="param.employeeName != null and param.employeeName != ''">
                AND em.lastname LIKE '%'+#{param.employeeName}+'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND em.workcode like '%'+#{param.workcode}+'%'
            </if>
            <if test="param.departmentIds != null and param.departmentIds.size()>0">
                AND em.departmentid IN
                <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
                    #{departmentId}
                </foreach>
            </if>
            <if test="param.positionIds != null and param.positionIds.size()>0">
                AND em.jobtitle IN
                <foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
                    #{positionId}
                </foreach>
            </if>
            -- 在职
            <if test="param.status != null  and param.status.toString == 'NORMAL'">
                AND em.status in (0,1,2,3)
            </if>
            -- 离职
            <if test="param.status != null  and param.status.toString == 'UNAVAILABLE'">
                AND em.status in (4,5,6)
            </if>
            )
        </if>

        ) emp1,
        (
        SELECT

        id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
        creator, create_time, update_time, delete_type, tenant_key

        FROM hrsa_salary_acct_emp
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>

    <select id="list4ConsolidatedTax" resultMap="SalaryAccEmployeeMap">
        SELECT DISTINCT
        <include refid="emp1Column"/>
        FROM (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        ) emp1,
        (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>
    <select id="list4ConsolidatedTax" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT DISTINCT
        <include refid="emp1Column"/>
        FROM (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        ) emp1,
        (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>
    <select id="list4ConsolidatedTax" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT DISTINCT
        <include refid="emp1Column"/>
        FROM (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        ) emp1,
        (
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        WHERE
        delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="otherSalaryAcctRecordIds" open="(" separator="," item="otherSalaryAcctRecordId" close=")">
            #{otherSalaryAcctRecordId}
        </foreach>
        ) emp2
        WHERE emp1.employee_id = emp2.employee_id AND emp1.tax_agent_id = emp2.tax_agent_id
    </select>

    <select id="listPage" resultMap="SalaryAccEmployeeMap">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="listPage" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="listPage" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>

    <select id="list" resultMap="SalaryAccEmployeeMap">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="list" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT

        <include refid="SalaryAccEmployeeColumn"/>

        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="list" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT

        <include refid="SalaryAccEmployeeColumn"/>

        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>

    <sql id="SalaryAcctEmployeeParamSql">
        <if test="param.salaryAcctRecordId != null">
            AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
        </if>
        <if test="param.ids != null and param.ids.size()>0">
            AND t.id IN
            <foreach collection="param.ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="param.taxAgentId != null">
            AND t.tax_agent_id = #{param.taxAgentId}
        </if>
        <if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
            AND t.tax_agent_id IN
            <foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
                #{taxAgentId}
            </foreach>
        </if>
        <if test="param.salaryMonths != null and param.salaryMonths.size()>0">
            AND t.salary_month IN
            <foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
                #{salaryMonth}
            </foreach>
        </if>
        -- 分部
        <if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
            AND t.subcompany_id IN
            <foreach collection="param.subcompanyIds" open="(" item="subcompanyId" separator="," close=")">
                #{subcompanyId}
            </foreach>
        </if>
        -- 部门
        <if test="param.departmentIds != null and param.departmentIds.size()>0">
            AND t.department_id IN
            <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
                #{departmentId}
            </foreach>
        </if>
        <if test="param.positionIds != null and param.positionIds.size()>0">
            AND t.jobtitle_id IN
            <foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
                #{positionId}
            </foreach>
        </if>
        <if test="param.statuses != null and param.statuses.size()>0">
            AND t.status IN
            <foreach collection="param.statuses" open="(" item="userStatus" separator="," close=")">
                #{userStatus}
            </foreach>
        </if>
        <if test="(param.employeeName != null and param.employeeName != '')
            or (param.workcode != null and param.workcode != '')">
            AND t.employee_id IN
            (
            SELECT id FROM hrmresource em WHERE em.status not in (7)

            <if test="param.employeeName != null and param.employeeName != ''">
                AND em.lastname LIKE CONCAT('%',#{param.employeeName},'%')
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND em.workcode like CONCAT('%',#{param.workcode},'%')
            </if>

            union all

            SELECT id FROM hrsa_external_employee extem WHERE extem.status not in (7)
            <if test="param.employeeName != null and param.employeeName != ''">
                AND extem.username LIKE CONCAT('%',#{param.employeeName},'%')
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND extem.workcode like CONCAT('%',#{param.workcode},'%')
            </if>
            )
        </if>
        <if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
            AND t.salary_acct_record_id IN
            <foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
                #{salaryAcctRecordId}
            </foreach>
        </if>
        <if test="param.employeeIds != null and param.employeeIds.size()>0">
            AND t.employee_id IN
            <foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
                #{employeeId}
            </foreach>
        </if>
        <if test="param.salarySobIds != null and param.salarySobIds.size()>0">
            AND t.salary_sob_id IN
            <foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
                #{salarySobId}
            </foreach>
        </if>
    </sql>
    <sql id="SalaryAcctEmployeeParamSql" databaseId="oracle">
        <if test="param.salaryAcctRecordId != null">
            AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
        </if>
        <if test="param.ids != null and param.ids.size()>0">
            AND t.id IN
            <foreach collection="param.ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="param.taxAgentId != null">
            AND t.tax_agent_id = #{param.taxAgentId}
        </if>
        <if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
            AND t.tax_agent_id IN
            <foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
                #{taxAgentId}
            </foreach>
        </if>
        <if test="param.salaryMonths != null and param.salaryMonths.size()>0">
            AND t.salary_month IN
            <foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
                #{salaryMonth}
            </foreach>
        </if>
        -- 分部
        <if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
            AND t.subcompany_id IN
            <foreach collection="param.subcompanyIds" open="(" item="subcompanyId" separator="," close=")">
                #{subcompanyId}
            </foreach>
        </if>
        -- 部门
        <if test="param.departmentIds != null and param.departmentIds.size()>0">
            AND t.department_id IN
            <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
                #{departmentId}
            </foreach>
        </if>
        <if test="param.positionIds != null and param.positionIds.size()>0">
            AND t.jobtitle_id IN
            <foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
                #{positionId}
            </foreach>
        </if>
        <if test="param.statuses != null and param.statuses.size()>0">
            AND t.status IN
            <foreach collection="param.statuses" open="(" item="userStatus" separator="," close=")">
                #{userStatus}
            </foreach>
        </if>
        <if test="(param.employeeName != null and param.employeeName != '')
             or (param.workcode != null and param.workcode != '')">
            AND t.employee_id IN
            (
            SELECT id FROM hrmresource em WHERE em.status not in (7)

            <if test="param.employeeName != null and param.employeeName != ''">
                AND em.lastname LIKE '%'||#{param.employeeName}||'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND em.workcode like '%'||#{param.workcode}||'%'
            </if>
            union all
            SELECT id FROM hrsa_external_employee extem WHERE extem.status not in (7)
            <if test="param.employeeName != null and param.employeeName != ''">
                AND extem.username LIKE '%'||#{param.employeeName}||'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND extem.workcode like '%'||#{param.workcode}||'%'
            </if>
            )
        </if>
        <if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
            AND t.salary_acct_record_id IN
            <foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
                #{salaryAcctRecordId}
            </foreach>
        </if>
        <if test="param.employeeIds != null and param.employeeIds.size()>0">
            AND t.employee_id IN
            <foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
                #{employeeId}
            </foreach>
        </if>
        <if test="param.salarySobIds != null and param.salarySobIds.size()>0">
            AND t.salary_sob_id IN
            <foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
                #{salarySobId}
            </foreach>
        </if>
    </sql>
    <sql id="SalaryAcctEmployeeParamSql" databaseId="sqlserver">
        <if test="param.salaryAcctRecordId != null">
            AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
        </if>
        <if test="param.ids != null and param.ids.size()>0">
            AND t.id IN
            <foreach collection="param.ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="param.taxAgentId != null">
            AND t.tax_agent_id = #{param.taxAgentId}
        </if>
        <if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
            AND t.tax_agent_id IN
            <foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
                #{taxAgentId}
            </foreach>
        </if>
        <if test="param.salaryMonths != null and param.salaryMonths.size()>0">
            AND t.salary_month IN
            <foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
                #{salaryMonth}
            </foreach>
        </if>
        -- 分部
        <if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
            AND t.subcompany_id IN
            <foreach collection="param.subcompanyIds" open="(" item="subcompanyId" separator="," close=")">
                #{subcompanyId}
            </foreach>
        </if>
        -- 部门
        <if test="param.departmentIds != null and param.departmentIds.size()>0">
            AND t.department_id IN
            <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
                #{departmentId}
            </foreach>
        </if>
        <if test="param.positionIds != null and param.positionIds.size()>0">
            AND t.jobtitle_id IN
            <foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
                #{positionId}
            </foreach>
        </if>
        <if test="param.statuses != null and param.statuses.size()>0">
            AND t.status IN
            <foreach collection="param.statuses" open="(" item="userStatus" separator="," close=")">
                #{userStatus}
            </foreach>
        </if>
        <if test="(param.employeeName != null and param.employeeName != '')
             or (param.workcode != null and param.workcode != '')">
            AND t.employee_id IN
            (
            SELECT id FROM hrmresource em WHERE em.status not in (7)

            <if test="param.employeeName != null and param.employeeName != ''">
                AND em.lastname LIKE '%'+#{param.employeeName}+'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND em.workcode like '%'+#{param.workcode}+'%'
            </if>
            union all

            SELECT id FROM hrsa_external_employee extem WHERE extem.status not in (7)
            <if test="param.employeeName != null and param.employeeName != ''">
                AND extem.username LIKE '%'+#{param.employeeName}+'%'
            </if>
            <if test="param.workcode != null and param.workcode != ''">
                AND extem.workcode like '%'+#{param.workcode}+'%'
            </if>
            )
        </if>
        <if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
            AND t.salary_acct_record_id IN
            <foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
                #{salaryAcctRecordId}
            </foreach>
        </if>
        <if test="param.employeeIds != null and param.employeeIds.size()>0">
            AND t.employee_id IN
            <foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
                #{employeeId}
            </foreach>
        </if>
        <if test="param.salarySobIds != null and param.salarySobIds.size()>0">
            AND t.salary_sob_id IN
            <foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
                #{salarySobId}
            </foreach>
        </if>
    </sql>

    <select id="listPage4Reduce" resultMap="SalaryAccEmployeeMap">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="listPage4Reduce" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT

        <include refid="SalaryAccEmployeeColumn"/>

        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>
    <select id="listPage4Reduce" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT

        <include refid="SalaryAccEmployeeColumn"/>

        FROM hrsa_salary_acct_emp t
        LEFT JOIN hrmresource e ON e.id = t.employee_id
        LEFT JOIN hrmdepartment d ON d.id = e.departmentid
        LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAcctRecordId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        <!-- 排序 -->
        <if test="param.orderRule != null">
            ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
        </if>
    </select>

    <select id="list4Reduce" resultMap="SalaryAccEmployeeMap">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAccountingId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        ORDER BY id DESC
    </select>
    <select id="list4Reduce" resultMap="SalaryAccEmployeeMap" databaseId="oracle">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id = #{param.salaryAccountingId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        ORDER BY id DESC
    </select>
    <select id="list4Reduce" resultMap="SalaryAccEmployeeMap" databaseId="sqlserver">
        SELECT
        <include refid="SalaryAccEmployeeColumn"/>
        FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="lastMonSalaryAcctRecordIds" item="salaryAcctRecordId" open="(" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
        AND employee_id NOT IN
        (
        SELECT employee_id
        FROM hrsa_salary_acct_emp
        WHERE AND delete_type = 0
        AND salary_acct_record_id = #{param.salaryAccountingId}
        )
        <include refid="SalaryAcctEmployeeParamSql"/>
        ORDER BY id DESC
    </select>

    <update id="deleteByIds">
        UPDATE hrsa_salary_acct_emp
        SET delete_type = 1
        WHERE delete_type = 0
        AND id IN
        <foreach collection="ids" open="(" item="id" separator="," close=")">
            #{id}
        </foreach>
    </update>

    <delete id="deleteBySalaryAcctRecordIds">
        DELETE FROM hrsa_salary_acct_emp
        WHERE delete_type = 0
        AND salary_acct_record_id IN
        <foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
            #{salaryAcctRecordId}
        </foreach>
    </delete>


    <resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
        <result column="id" property="id"/>
        <result column="salary_acct_record_id" property="salaryAcctRecordId"/>
        <result column="salary_sob_id" property="salarySobId"/>
        <result column="employee_id" property="employeeId"/>
        <result column="tax_agent_id" property="taxAgentId"/>
        <result column="salary_month" property="salaryMonth"/>
        <result column="creator" property="creator"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="delete_type" property="deleteType"/>
        <result column="tenant_key" property="tenantKey"/>
        <result column="lock_status" property="lockStatus"/>
        <result column="subcompany_name" property="subcompanyName"/>
        <result column="subcompany_id" property="subcompanyId"/>
        <result column="department_name" property="departmentName"/>
        <result column="department_id" property="departmentId"/>
        <result column="jobtitle_name" property="jobtitleName"/>
        <result column="jobtitle_id" property="jobtitleId"/>
        <result column="jobcall" property="jobcall"/>
        <result column="jobcall_id" property="jobcallId"/>
        <result column="status" property="status"/>
        <result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
        <result column="account_type" property="accountType"/>
    </resultMap>

    <!-- 表字段 -->
    <sql id="baseColumns">
        t
        .
        id
        , t.salary_acct_record_id
        , t.salary_sob_id
        , t.employee_id
        , t.tax_agent_id
        , t.salary_month
        , t.creator
        , t.create_time
        , t.update_time
        , t.delete_type
        , t.tenant_key
        , t.employee_type
        , t.lock_status
        , t.subcompany_name
        , t.subcompany_id
        , t.department_name
        , t.department_id
        , t.jobtitle_name
        , t.jobtitle_id
        , t.jobcall
        , t.jobcall_id
        , t.status
        , t.lock_items
        , t.account_type
    </sql>


    <!-- 条件查询 -->
    <select id="listSome" resultMap="BaseResultMap"
            parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
        SELECT
        <include refid="baseColumns"/>
        FROM hrsa_salary_acct_emp t
        WHERE delete_type = 0
        <if test="id != null">
            AND id = #{id}
        </if>
        <if test="salaryAcctRecordId != null">
            AND salary_acct_record_id = #{salaryAcctRecordId}
        </if>
        <if test="salarySobId != null">
            AND salary_sob_id = #{salarySobId}
        </if>
        <if test="employeeId != null">
            AND employee_id = #{employeeId}
        </if>
        <if test="taxAgentId != null">
            AND tax_agent_id = #{taxAgentId}
        </if>
        <if test="salaryMonth != null">
            AND salary_month = #{salaryMonth}
        </if>
        <if test="creator != null">
            AND creator = #{creator}
        </if>
        <if test="createTime != null">
            AND create_time = #{createTime}
        </if>
        <if test="updateTime != null">
            AND update_time = #{updateTime}
        </if>
        <if test="deleteType != null">
            AND delete_type = #{deleteType}
        </if>
        <if test="tenantKey != null">
            AND tenant_key = #{tenantKey}
        </if>
        <if test="ids != null and ids.size()>0">
            AND id IN
            <foreach collection="ids" open="(" item="id" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="salaryAcctRecordIds != null and salaryAcctRecordIds.size()>0">
            AND salary_acct_record_id IN
            <foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
                #{salaryAcctRecordId}
            </foreach>
        </if>
        <if test="employeeIds != null and employeeIds.size()>0">
            AND employee_id IN
            <foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
                #{employeeId}
            </foreach>
        </if>
        <if test="taxAgentIds != null and taxAgentIds.size()>0">
            AND tax_agent_id IN
            <foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
                #{taxAgentId}
            </foreach>
        </if>
        <if test="salarySobIds != null and salarySobIds.size()>0">
            AND salary_sob_id IN
            <foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
                #{salarySobId}
            </foreach>
        </if>
        <if test="salaryMonths != null and salaryMonths.size()>0">
            AND salary_month IN
            <foreach collection="salaryMonths" open="(" item="salaryMonth" separator="," close=")">
                #{salaryMonth}
            </foreach>
        </if>
        ORDER BY id DESC
    </select>


    <!-- 根据主键获取单条记录 -->
    <select id="getById" resultMap="BaseResultMap" parameterType="Long">
        SELECT
        <include refid="baseColumns"/>
        FROM hrsa_salary_acct_emp t
        WHERE id = #{id} AND delete_type = 0
    </select>

    <update id="lockByAcctEmpIds">
        UPDATE hrsa_salary_acct_emp
        SET lock_status = #{lockStatus}
        WHERE delete_type = 0
        AND id IN
        <foreach collection="acctEmpIds" open="(" item="acctEmpId" separator="," close=")">
            #{acctEmpId}
        </foreach>
    </update>

    <update id="lockByRecordId">
        UPDATE hrsa_salary_acct_emp
        SET lock_status = #{lockStatus}
        WHERE delete_type = 0
          AND salary_acct_record_id = #{recordId}
    </update>

    <update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
        UPDATE hrsa_salary_acct_emp
        <set>
            <if test="salaryAcctEmployeePO.salaryAcctRecordId != null" >
                salary_acct_record_id=#{salaryAcctEmployeePO.salaryAcctRecordId},
            </if>
            <if test="salaryAcctEmployeePO.salarySobId != null" >
                salary_sob_id=#{salaryAcctEmployeePO.salarySobId},
            </if>
            <if test="salaryAcctEmployeePO.employeeId != null" >
                employee_id=#{salaryAcctEmployeePO.employeeId},
            </if>
            <if test="salaryAcctEmployeePO.taxAgentId != null" >
                tax_agent_id=#{salaryAcctEmployeePO.taxAgentId},
            </if>
            <if test="salaryAcctEmployeePO.salaryMonth != null" >
                salary_month=#{salaryAcctEmployeePO.salaryMonth},
            </if>
            <if test="salaryAcctEmployeePO.createTime != null" >
                create_time=#{salaryAcctEmployeePO.createTime},
            </if>
            <if test="salaryAcctEmployeePO.updateTime != null" >
                update_time=#{salaryAcctEmployeePO.updateTime},
            </if>
            <if test="salaryAcctEmployeePO.tenantKey != null" >
                tenant_key=#{salaryAcctEmployeePO.tenantKey},
            </if>
            <if test="salaryAcctEmployeePO.employeeType != null" >
                employee_type=#{salaryAcctEmployeePO.employeeType},
            </if>
            <if test="salaryAcctEmployeePO.lockStatus != null" >
                lock_status=#{salaryAcctEmployeePO.lockStatus},
            </if>
            <if test="salaryAcctEmployeePO.subcompanyName != null" >
                subcompany_name=#{salaryAcctEmployeePO.subcompanyName},
            </if>
            <if test="salaryAcctEmployeePO.subcompanyId != null" >
                subcompany_id=#{salaryAcctEmployeePO.subcompanyId},
            </if>
            <if test="salaryAcctEmployeePO.departmentName != null" >
                department_name=#{salaryAcctEmployeePO.departmentName},
            </if>
            <if test="salaryAcctEmployeePO.departmentId != null" >
                department_id=#{salaryAcctEmployeePO.departmentId},
            </if>
            <if test="salaryAcctEmployeePO.jobtitleName != null" >
                jobtitle_name=#{salaryAcctEmployeePO.jobtitleName},
            </if>
            <if test="salaryAcctEmployeePO.jobtitleId != null" >
                jobtitle_id=#{salaryAcctEmployeePO.jobtitleId},
            </if>
            <if test="salaryAcctEmployeePO.jobcall != null" >
                jobcall=#{salaryAcctEmployeePO.jobcall},
            </if>
            <if test="salaryAcctEmployeePO.jobcallId != null" >
                jobcall_id=#{salaryAcctEmployeePO.jobcallId},
            </if>
            <if test="salaryAcctEmployeePO.status != null" >
                status=#{salaryAcctEmployeePO.status},
            </if>
            <if test="salaryAcctEmployeePO.accountType != null" >
                account_type=#{salaryAcctEmployeePO.accountType},
            </if>
        </set>
        WHERE id = #{salaryAcctEmployeePO.id} AND delete_type = 0
    </update>

    <update id="lock" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
        UPDATE hrsa_salary_acct_emp
        <set>
            lock_items =
            #{lockItems, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
        </set>
        WHERE id = #{id} AND delete_type = 0
    </update>

</mapper>
