TProveRecordMapper.xml 6.91 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
<?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.yifu.archives.mapper.TProveRecordMapper">
    <resultMap id="tProveRecordMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TProveRecord">
        <id property="id" column="id"/>
        <result property="employeeInfo" column="employee_info"/>
        <result property="creatUser" column="creat_user"/>
        <result property="creatDate" column="creat_date"/>
        <result property="startMonth" column="start_month"/>
        <result property="endMonth" column="end_month"/>
        <result property="salary" column="salary"/>
        <result property="proveSalary" column="prove_salary"/>
        <result property="isInvalid" column="is_invalid"/>
        <result property="invalidReason" column="invalid_reason"/>
        <result property="no" column="no"/>
        <result property="purpose" column="purpose"/>
        <result property="sumType" column="sum_type"/>
        <result property="proveType" column="prove_type"/>
        <result property="number" column="number"/>
        <result property="unitName" column="unit_name"/>
        <result property="unitAddr" column="unit_addr"/>
        <result property="phone" column="phone"/>
        <result property="employeeIdCard" column="EMPLOYEE_ID_CARD"/>
        <result property="employeeName" column="EMPLOYEE_NAME"/>
        <result property="employeeSettleDepartName" column="EMPLOYEE_SETTLE_DEPART_NAME"/>
        <result property="creatUserName" column="CREAT_USER_NAME"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.id,
             a.employee_info,
             a.creat_user,
             a.creat_date,
             a.start_month,
             a.end_month,
             a.salary,
             a.prove_salary,
             a.is_invalid,
             a.invalid_reason,
             a.no,
             a.purpose,
             a.sum_type,
             a.prove_type,
             a.number,
             a.unit_name,
             a.unit_addr,
             a.phone,
             a.EMPLOYEE_ID_CARD,
             a.EMPLOYEE_NAME,
             a.EMPLOYEE_SETTLE_DEPART_NAME,
             a.CREAT_USER_NAME

         </sql>
    <sql id="tProveRecord_where">
        <if test="tProveRecord != null">
			<if test="tProveRecord.idList != null and tProveRecord.idList.size>0">
				AND a.id in
				<foreach item="idStr" index="index" collection="tProveRecord.idList" open="(" separator="," close=")">
					#{idStr}
				</foreach>
			</if>
            <if test="tProveRecord.creatUser != null">
                AND a.creat_user = #{tProveRecord.creatUser}
            </if>
            <if test="tProveRecord.employeeIdCard != null and tProveRecord.employeeIdCard.trim() != ''">
                AND a.EMPLOYEE_ID_CARD like '%${tProveRecord.employeeIdCard}%'
            </if>
            <if test="tProveRecord.employeeName != null and tProveRecord.employeeName.trim() != ''">
                AND a.EMPLOYEE_NAME like '%${tProveRecord.employeeName}%'
            </if>
            <if test="tProveRecord.creatDate != null">
                AND a.creat_date = #{tProveRecord.creatDate}
            </if>
            <if test="tProveRecord.startMonth != null and tProveRecord.startMonth.trim() != ''">
                AND a.start_month = #{tProveRecord.startMonth}
            </if>
            <if test="tProveRecord.endMonth != null and tProveRecord.endMonth.trim() != ''">
                AND a.end_month = #{tProveRecord.endMonth}
            </if>
            <if test="tProveRecord.salary != null">
                AND a.salary = #{tProveRecord.salary}
            </if>
            <if test="tProveRecord.proveSalary != null">
                AND a.prove_salary = #{tProveRecord.proveSalary}
            </if>
            <if test="tProveRecord.isInvalid != null">
                AND a.is_invalid = #{tProveRecord.isInvalid}
            </if>
            <if test="tProveRecord.invalidReason != null and tProveRecord.invalidReason.trim() != ''">
                AND a.invalid_reason = #{tProveRecord.invalidReason}
            </if>
            <if test="tProveRecord.no != null and tProveRecord.no.trim() != ''">
                AND a.no = #{tProveRecord.no}
            </if>
            <if test="tProveRecord.purpose != null and tProveRecord.purpose.trim() != ''">
                AND a.purpose = #{tProveRecord.purpose}
            </if>
            <if test="tProveRecord.sumType != null">
                AND a.sum_type = #{tProveRecord.sumType}
            </if>
            <if test="tProveRecord.proveType != null">
                AND a.prove_type = #{tProveRecord.proveType}
            </if>
            <if test="tProveRecord.number != null">
                AND a.number = #{tProveRecord.number}
            </if>
            <if test="tProveRecord.unitName != null and tProveRecord.unitName.trim() != ''">
                AND a.unit_name = #{tProveRecord.unitName}
            </if>
            <if test="tProveRecord.unitAddr != null and tProveRecord.unitAddr.trim() != ''">
                AND a.unit_addr = #{tProveRecord.unitAddr}
            </if>
            <if test="tProveRecord.phone != null and tProveRecord.phone.trim() != ''">
                AND a.phone = #{tProveRecord.phone}
            </if>
        </if>
    </sql>
    <!--tProveRecord简单分页查询-->
    <select id="getTProveRecordPage" resultMap="tProveRecordMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_prove_record a
        <where>
            1=1
            <include refid="tProveRecord_where"/>
        </where>
hongguangwu's avatar
hongguangwu committed
126
		order by a.creat_date desc
hongguangwu's avatar
hongguangwu committed
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 167
    </select>

	<!--导出查条数-->
	<select id="getCountByExport" resultType="java.lang.Integer">
		SELECT
			count(1)
		FROM t_prove_record a
		<where>
			1=1
			<include refid="tProveRecord_where"/>
		</where>
	</select>

    <!--导出list-->
    <select id="getRecordInfoNoPage" resultMap="tProveRecordMap">
        SELECT
			a.id,
			a.creat_date,
			a.start_month,
			a.end_month,
			a.salary,
			a.prove_salary,
			if(a.is_invalid='0','否','是') as is_invalid,
			a.invalid_reason,
			a.no,
			a.purpose,
			if(a.sum_type='0','实发平均','应发平均') as sum_type,
			if(a.prove_type='0','正式员工证明','试用期员工证明') as prove_type,
			a.number,
			a.unit_name,
			a.unit_addr,
			a.phone,
			a.EMPLOYEE_ID_CARD,
			a.EMPLOYEE_NAME,
			a.EMPLOYEE_SETTLE_DEPART_NAME,
			a.CREAT_USER_NAME
        FROM t_prove_record a
        <where>
            1=1
            <include refid="tProveRecord_where"/>
        </where>
hongguangwu's avatar
hongguangwu committed
168
		order by a.creat_date desc
hongguangwu's avatar
hongguangwu committed
169 170 171 172 173 174 175 176 177 178
		<if test="tProveRecord != null">
			<if test="tProveRecord.limitStart != null">
				limit #{tProveRecord.limitStart},#{tProveRecord.limitEnd}
			</if>
		</if>
    </select>
    <select id="createNo" resultType="java.lang.Integer">
      select max(right(a.`no`,5))+1 from t_prove_record a where a.`no` like '${str}%'
    </select>
</mapper>