TBusSalaryMapper.xml 7.59 KB
Newer Older
hongguangwu's avatar
hongguangwu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
<?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.yifu.cloud.plus.v1.business.mapper.salary.TBusSalaryMapper">
    <resultMap id="tBusSalaryMap" type="com.yifu.cloud.plus.v1.business.entity.salary.TBusSalary">
        <id property="id" column="id"/>
        <result property="teleNo" column="tele_no"/>
        <result property="empName" column="emp_name"/>
        <result property="empIdCard" column="emp_id_card"/>
        <result property="deptId" column="dept_id"/>
        <result property="deptLevel" column="dept_level"/>
        <result property="deptName" column="dept_name"/>
        <result property="deptTreeLogo" column="dept_tree_logo"/>
        <result property="post" column="post"/>
        <result property="salaryMonth" column="salary_month"/>
        <result property="relaySalary" column="relay_salary"/>
        <result property="relayIncent" column="relay_incent"/>
        <result property="relayOther" column="relay_other"/>
        <result property="relaySum" column="relay_sum"/>
        <result property="withholidPersonSocial" column="withholid_person_social"/>
        <result property="withholidPersonFund" column="withholid_person_fund"/>
        <result property="withholidPersonTax" column="withholid_person_tax"/>
        <result property="withholidOther" column="withholid_other"/>
        <result property="withholidSum" column="withholid_sum"/>
        <result property="actualSalary" column="actual_salary"/>
        <result property="unitSocial" column="unit_social"/>
        <result property="unitFund" column="unit_fund"/>
        <result property="createUserId" column="create_user_id"/>
        <result property="createUserName" column="create_user_name"/>
        <result property="createTime" column="create_time"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.id,
                  a.tele_no,
                  a.emp_name,
                  a.emp_id_card,
                  a.dept_id,
                  a.dept_level,
                  a.dept_name,
                  a.dept_tree_logo,
                  a.post,
                  a.salary_month,
                  a.relay_salary,
                  a.relay_incent,
                  a.relay_other,
                  a.relay_sum,
                  a.withholid_person_social,
                  a.withholid_person_fund,
                  a.withholid_person_tax,
                  a.withholid_other,
                  a.withholid_sum,
                  a.actual_salary,
                  a.unit_social,
                  a.unit_fund,
                  a.create_user_id,
                  a.create_user_name,
                  a.create_time
         </sql>
    <sql id="tBusSalary_where">
        <if test="tBusSalary != null">
            <if test="tBusSalary.id != null and tBusSalary.id.trim() != ''">
                AND a.id = #{tBusSalary.id}
            </if>
            <if test="tBusSalary.teleNo != null and tBusSalary.teleNo.trim() != ''">
                AND a.tele_no = #{tBusSalary.teleNo}
            </if>
            <if test="tBusSalary.empName != null and tBusSalary.empName.trim() != ''">
                AND a.emp_name like concat('%',#{tBusSalary.empName}, '%')
            </if>
            <if test="tBusSalary.empIdCard != null and tBusSalary.empIdCard.trim() != ''">
                AND a.emp_id_card like concat(#{tBusSalary.empIdCard}, '%')
            </if>
            /* 查找部门树以及底下的数据 */
            <if test="tBusSalary.deptId != null and tBusSalary.deptId != 1">
                AND (a.dept_id = #{tBusSalary.deptId} or a.dept_tree_logo like concat('%-', #{tBusSalary.deptId},'-%'))
            </if>
            <if test="tBusSalary.deptLevel != null">
                AND a.dept_level = #{tBusSalary.deptLevel}
            </if>
            <if test="tBusSalary.deptName != null and tBusSalary.deptName.trim() != ''">
                AND a.dept_name like concat('%', #{tBusSalary.deptName}, '%')
            </if>
            <if test="tBusSalary.deptTreeLogo != null and tBusSalary.deptTreeLogo.trim() != ''">
                AND a.dept_tree_logo = #{tBusSalary.deptTreeLogo}
            </if>
            <if test="tBusSalary.post != null and tBusSalary.post.trim() != ''">
                AND a.post = #{tBusSalary.post}
            </if>
            <if test="tBusSalary.salaryMonth != null and tBusSalary.salaryMonth.trim() != ''">
                AND a.salary_month = #{tBusSalary.salaryMonth}
            </if>
            <if test="tBusSalary.relaySalary != null">
                AND a.relay_salary = #{tBusSalary.relaySalary}
            </if>
            <if test="tBusSalary.relayIncent != null">
                AND a.relay_incent = #{tBusSalary.relayIncent}
            </if>
            <if test="tBusSalary.relayOther != null">
                AND a.relay_other = #{tBusSalary.relayOther}
            </if>
            <if test="tBusSalary.relaySum != null">
                AND a.relay_sum = #{tBusSalary.relaySum}
            </if>
            <if test="tBusSalary.withholidPersonSocial != null">
                AND a.withholid_person_social = #{tBusSalary.withholidPersonSocial}
            </if>
            <if test="tBusSalary.withholidPersonFund != null">
                AND a.withholid_person_fund = #{tBusSalary.withholidPersonFund}
            </if>
            <if test="tBusSalary.withholidPersonTax != null">
                AND a.withholid_person_tax = #{tBusSalary.withholidPersonTax}
            </if>
            <if test="tBusSalary.withholidOther != null">
                AND a.withholid_other = #{tBusSalary.withholidOther}
            </if>
            <if test="tBusSalary.withholidSum != null">
                AND a.withholid_sum = #{tBusSalary.withholidSum}
            </if>
            <if test="tBusSalary.actualSalary != null">
                AND a.actual_salary = #{tBusSalary.actualSalary}
            </if>
            <if test="tBusSalary.unitSocial != null">
                AND a.unit_social = #{tBusSalary.unitSocial}
            </if>
            <if test="tBusSalary.unitFund != null">
                AND a.unit_fund = #{tBusSalary.unitFund}
            </if>
            <if test="tBusSalary.createUserId != null and tBusSalary.createUserId.trim() != ''">
                AND a.create_user_id = #{tBusSalary.createUserId}
            </if>
            <if test="tBusSalary.createUserName != null and tBusSalary.createUserName.trim() != ''">
                AND a.create_user_name = #{tBusSalary.createUserName}
            </if>
            <if test="tBusSalary.createTime != null">
                AND a.create_time = #{tBusSalary.createTime}
            </if>
        </if>
    </sql>
    <!--tBusSalary简单分页查询-->
    <select id="getTBusSalaryPage" resultMap="tBusSalaryMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_salary a
        <where>
            1=1
            <include refid="tBusSalary_where"/>
        </where>
    </select>
    <!--tBusSalary导出-->
    <select id="doExport" resultMap="tBusSalaryMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_salary a
        <where>
            1=1
            <if test="idList != null and idList.size > 0">
                AND a.id in
                <foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="idList == null or idList.size == 0">
                <include refid="tBusSalary_where"/>
            </if>
        </where>
    </select>
</mapper>