<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!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.TPersonnelRosterMapper">

  <resultMap id="tPersonnelRosterMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster">
    <id property="id" column="ID"/>
    <result property="customerName" column="CUSTOMER_NAME"/>
    <result property="departName" column="DEPART_NAME"/>
    <result property="departNo" column="DEPART_NO"/>
    <result property="businessPrimary" column="BUSINESS_PRIMARY"/>
    <result property="businessSeconed" column="BUSINESS_SECONED"/>
    <result property="businessThird" column="BUSINESS_THIRD"/>
    <result property="label" column="LABEL"/>
    <result property="businessType" column="BUSINESS_TYPE"/>
    <result property="buBelong" column="BU_BELONG"/>
    <result property="empType" column="EMP_TYPE"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empSex" column="EMP_SEX"/>
    <result property="empBirthDate" column="EMP_BIRTH_DATE"/>
    <result property="empAge" column="EMP_AGE"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="bankNo" column="BANK_NO"/>
    <result property="bankName" column="BANK_NAME"/>
    <result property="bankProvince" column="BANK_PROVINCE"/>
    <result property="bankCity" column="BANK_CITY"/>
    <result property="bankNameSub" column="BANK_NAME_SUB"/>
    <result property="empPhone" column="EMP_PHONE"/>
    <result property="empProvince" column="EMP_PROVINCE"/>
    <result property="empCity" column="EMP_CITY"/>
    <result property="empTown" column="EMP_TOWN"/>
    <result property="socialAddress" column="SOCIAL_ADDRESS"/>
    <result property="contractApplyNo" column="CONTRACT_APPLY_NO"/>
    <result property="contractStart" column="CONTRACT_START"/>
    <result property="contractEnd" column="CONTRACT_END"/>
    <result property="contractType" column="CONTRACT_TYPE"/>
    <result property="businessDetail" column="BUSINESS_DETAIL"/>
    <result property="signType" column="SIGN_TYPE"/>
    <result property="signTerm" column="SIGN_TERM"/>
    <result property="contractPartyA" column="CONTRACT_PARTY_A"/>
    <result property="contractPost" column="CONTRACT_POST"/>
    <result property="contractTaskTime" column="CONTRACT_TASK_TIME"/>
    <result property="contractCode" column="CONTRACT_CODE"/>
    <result property="contractCreater" column="CONTRACT_CREATER"/>
    <result property="contractCreateTime" column="CONTRACT_CREATE_TIME"/>
    <result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
    <result property="dataCreateMomth" column="DATA_CREATE_MOMTH"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.CUSTOMER_NAME,
                a.DEPART_NAME,
                a.DEPART_NO,
                a.BUSINESS_PRIMARY,
                a.BUSINESS_SECONED,
                a.BUSINESS_THIRD,
                a.LABEL,
                a.BUSINESS_TYPE,
                a.BU_BELONG,
                a.EMP_TYPE,
                a.EMP_NAME,
                a.EMP_SEX,
                a.EMP_BIRTH_DATE,
                a.EMP_AGE,
                a.EMP_IDCARD,
                a.BANK_NO,
                a.BANK_NAME,
                a.BANK_PROVINCE,
                a.BANK_CITY,
                a.BANK_NAME_SUB,
                a.EMP_PHONE,
                a.EMP_PROVINCE,
                a.EMP_CITY,
                a.EMP_TOWN,
                a.SOCIAL_ADDRESS,
                a.CONTRACT_APPLY_NO,
                a.CONTRACT_START,
                a.CONTRACT_END,
                a.CONTRACT_TYPE,
                a.BUSINESS_DETAIL,
                a.SIGN_TYPE,
                a.SIGN_TERM,
                a.CONTRACT_PARTY_A,
                a.CONTRACT_POST,
                a.CONTRACT_TASK_TIME,
                a.CONTRACT_CODE,
                a.CONTRACT_CREATER,
                a.CONTRACT_CREATE_TIME,
                a.DATA_CREATE_MONTH,
                a.DATA_CREATE_MOMTH
    </sql>
    <sql id="tPersonnelRoster_where">
        <if test="tPersonnelRoster != null">
                    <if test="tPersonnelRoster.id != null and tPersonnelRoster.id.trim() != ''">
                        AND a.ID = #{tPersonnelRoster.id}
                    </if>
                    <if test="tPersonnelRoster.customerName != null and tPersonnelRoster.customerName.trim() != ''">
                        AND a.CUSTOMER_NAME = #{tPersonnelRoster.customerName}
                    </if>
                    <if test="tPersonnelRoster.departName != null and tPersonnelRoster.departName.trim() != ''">
                        AND a.DEPART_NAME = #{tPersonnelRoster.departName}
                    </if>
                    <if test="tPersonnelRoster.departNo != null and tPersonnelRoster.departNo.trim() != ''">
                        AND a.DEPART_NO = #{tPersonnelRoster.departNo}
                    </if>
                    <if test="tPersonnelRoster.businessPrimary != null and tPersonnelRoster.businessPrimary.trim() != ''">
                        AND a.BUSINESS_PRIMARY = #{tPersonnelRoster.businessPrimary}
                    </if>
                    <if test="tPersonnelRoster.businessSeconed != null and tPersonnelRoster.businessSeconed.trim() != ''">
                        AND a.BUSINESS_SECONED = #{tPersonnelRoster.businessSeconed}
                    </if>
                    <if test="tPersonnelRoster.businessThird != null and tPersonnelRoster.businessThird.trim() != ''">
                        AND a.BUSINESS_THIRD = #{tPersonnelRoster.businessThird}
                    </if>
                    <if test="tPersonnelRoster.label != null and tPersonnelRoster.label.trim() != ''">
                        AND a.LABEL = #{tPersonnelRoster.label}
                    </if>
                    <if test="tPersonnelRoster.businessType != null and tPersonnelRoster.businessType.trim() != ''">
                        AND a.BUSINESS_TYPE = #{tPersonnelRoster.businessType}
                    </if>
                    <if test="tPersonnelRoster.buBelong != null and tPersonnelRoster.buBelong.trim() != ''">
                        AND a.BU_BELONG = #{tPersonnelRoster.buBelong}
                    </if>
                    <if test="tPersonnelRoster.empType != null and tPersonnelRoster.empType.trim() != ''">
                        AND a.EMP_TYPE = #{tPersonnelRoster.empType}
                    </if>
                    <if test="tPersonnelRoster.empName != null and tPersonnelRoster.empName.trim() != ''">
                        AND a.EMP_NAME = #{tPersonnelRoster.empName}
                    </if>
                    <if test="tPersonnelRoster.empSex != null and tPersonnelRoster.empSex.trim() != ''">
                        AND a.EMP_SEX = #{tPersonnelRoster.empSex}
                    </if>
                    <if test="tPersonnelRoster.empBirthDate != null">
                        AND a.EMP_BIRTH_DATE = #{tPersonnelRoster.empBirthDate}
                    </if>
                    <if test="tPersonnelRoster.empAge != null and tPersonnelRoster.empAge.trim() != ''">
                        AND a.EMP_AGE = #{tPersonnelRoster.empAge}
                    </if>
                    <if test="tPersonnelRoster.empIdcard != null and tPersonnelRoster.empIdcard.trim() != ''">
                        AND a.EMP_IDCARD = #{tPersonnelRoster.empIdcard}
                    </if>
                    <if test="tPersonnelRoster.bankNo != null and tPersonnelRoster.bankNo.trim() != ''">
                        AND a.BANK_NO = #{tPersonnelRoster.bankNo}
                    </if>
                    <if test="tPersonnelRoster.bankName != null and tPersonnelRoster.bankName.trim() != ''">
                        AND a.BANK_NAME = #{tPersonnelRoster.bankName}
                    </if>
                    <if test="tPersonnelRoster.bankProvince != null and tPersonnelRoster.bankProvince.trim() != ''">
                        AND a.BANK_PROVINCE = #{tPersonnelRoster.bankProvince}
                    </if>
                    <if test="tPersonnelRoster.bankCity != null and tPersonnelRoster.bankCity.trim() != ''">
                        AND a.BANK_CITY = #{tPersonnelRoster.bankCity}
                    </if>
                    <if test="tPersonnelRoster.bankNameSub != null and tPersonnelRoster.bankNameSub.trim() != ''">
                        AND a.BANK_NAME_SUB = #{tPersonnelRoster.bankNameSub}
                    </if>
                    <if test="tPersonnelRoster.empPhone != null and tPersonnelRoster.empPhone.trim() != ''">
                        AND a.EMP_PHONE = #{tPersonnelRoster.empPhone}
                    </if>
                    <if test="tPersonnelRoster.empProvince != null and tPersonnelRoster.empProvince.trim() != ''">
                        AND a.EMP_PROVINCE = #{tPersonnelRoster.empProvince}
                    </if>
                    <if test="tPersonnelRoster.empCity != null and tPersonnelRoster.empCity.trim() != ''">
                        AND a.EMP_CITY = #{tPersonnelRoster.empCity}
                    </if>
                    <if test="tPersonnelRoster.empTown != null and tPersonnelRoster.empTown.trim() != ''">
                        AND a.EMP_TOWN = #{tPersonnelRoster.empTown}
                    </if>
                    <if test="tPersonnelRoster.socialAddress != null and tPersonnelRoster.socialAddress.trim() != ''">
                        AND a.SOCIAL_ADDRESS = #{tPersonnelRoster.socialAddress}
                    </if>
                    <if test="tPersonnelRoster.contractApplyNo != null and tPersonnelRoster.contractApplyNo.trim() != ''">
                        AND a.CONTRACT_APPLY_NO = #{tPersonnelRoster.contractApplyNo}
                    </if>
                    <if test="tPersonnelRoster.contractStart != null and tPersonnelRoster.contractStart.trim() != ''">
                        AND a.CONTRACT_START = #{tPersonnelRoster.contractStart}
                    </if>
                    <if test="tPersonnelRoster.contractEnd != null and tPersonnelRoster.contractEnd.trim() != ''">
                        AND a.CONTRACT_END = #{tPersonnelRoster.contractEnd}
                    </if>
                    <if test="tPersonnelRoster.contractType != null and tPersonnelRoster.contractType.trim() != ''">
                        AND a.CONTRACT_TYPE = #{tPersonnelRoster.contractType}
                    </if>
                    <if test="tPersonnelRoster.businessDetail != null and tPersonnelRoster.businessDetail.trim() != ''">
                        AND a.BUSINESS_DETAIL = #{tPersonnelRoster.businessDetail}
                    </if>
                    <if test="tPersonnelRoster.signType != null and tPersonnelRoster.signType.trim() != ''">
                        AND a.SIGN_TYPE = #{tPersonnelRoster.signType}
                    </if>
                    <if test="tPersonnelRoster.signTerm != null and tPersonnelRoster.signTerm.trim() != ''">
                        AND a.SIGN_TERM = #{tPersonnelRoster.signTerm}
                    </if>
                    <if test="tPersonnelRoster.contractPartyA != null and tPersonnelRoster.contractPartyA.trim() != ''">
                        AND a.CONTRACT_PARTY_A = #{tPersonnelRoster.contractPartyA}
                    </if>
                    <if test="tPersonnelRoster.contractPost != null and tPersonnelRoster.contractPost.trim() != ''">
                        AND a.CONTRACT_POST = #{tPersonnelRoster.contractPost}
                    </if>
                    <if test="tPersonnelRoster.contractTaskTime != null and tPersonnelRoster.contractTaskTime.trim() != ''">
                        AND a.CONTRACT_TASK_TIME = #{tPersonnelRoster.contractTaskTime}
                    </if>
                    <if test="tPersonnelRoster.contractCode != null and tPersonnelRoster.contractCode.trim() != ''">
                        AND a.CONTRACT_CODE = #{tPersonnelRoster.contractCode}
                    </if>
                    <if test="tPersonnelRoster.contractCreater != null and tPersonnelRoster.contractCreater.trim() != ''">
                        AND a.CONTRACT_CREATER = #{tPersonnelRoster.contractCreater}
                    </if>
                    <if test="tPersonnelRoster.contractCreateTime != null and tPersonnelRoster.contractCreateTime.trim() != ''">
                        AND a.CONTRACT_CREATE_TIME = #{tPersonnelRoster.contractCreateTime}
                    </if>
                    <if test="tPersonnelRoster.dataCreateMonth != null and tPersonnelRoster.dataCreateMonth.trim() != ''">
                        AND a.DATA_CREATE_MONTH = #{tPersonnelRoster.dataCreateMonth}
                    </if>
                    <if test="tPersonnelRoster.dataCreateMomth != null and tPersonnelRoster.dataCreateMomth.trim() != ''">
                        AND a.DATA_CREATE_MOMTH = #{tPersonnelRoster.dataCreateMomth}
                    </if>
        </if>
    </sql>
    <!--tPersonnelRoster简单分页查询-->
    <select id="getTPersonnelRosterPage" resultMap="tPersonnelRosterMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_personnel_roster a
        <where>
            1=1
            <include refid="tPersonnelRoster_where"/>
        </where>
    </select>
</mapper>
