<?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.TContractAutoLogMapper">

  <resultMap id="tContractAutoLogMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TContractAutoLog">
    <id property="id" column="ID"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="joinLeaveDate" column="JOIN_LEAVE_DATE"/>
	  <result property="contractStartDate" column="CONTRACT_START_DATE"/>
    <result property="phone" column="PHONE"/>
    <result property="errorInfo" column="ERROR_INFO"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="contractId" column="CONTRACT_ID"/>
    <result property="mainId" column="MAIN_ID"/>
    <result property="isUrg" column="is_urg"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.EMP_NAME,
                a.EMP_IDCARD,
                a.JOIN_LEAVE_DATE,
                a.PHONE,
                a.ERROR_INFO,
                a.CREATE_BY,
                a.UPDATE_BY,
                a.CREATE_NAME,
                a.UPDATE_TIME,
                a.CREATE_TIME,a.CONTRACT_ID,a.MAIN_ID,a.is_urg,a.CONTRACT_START_DATE
    </sql>
    <sql id="tContractAutoLog_where">
        <if test="tContractAutoLog != null">
                    <if test="tContractAutoLog.id != null and tContractAutoLog.id.trim() != ''">
                        AND a.ID = #{tContractAutoLog.id}
                    </if>
                    <if test="tContractAutoLog.empName != null and tContractAutoLog.empName.trim() != ''">
                        AND a.EMP_NAME = #{tContractAutoLog.empName}
                    </if>
					<if test="tContractAutoLog.contractId != null and tContractAutoLog.contractId.trim() != ''">
						AND a.CONTRACT_ID = #{tContractAutoLog.contractId}
					</if>
                    <if test="tContractAutoLog.empIdcard != null and tContractAutoLog.empIdcard.trim() != ''">
                        AND a.EMP_IDCARD = #{tContractAutoLog.empIdcard}
                    </if>
                    <if test="tContractAutoLog.joinLeaveDate != null">
                        AND a.JOIN_LEAVE_DATE = #{tContractAutoLog.joinLeaveDate}
                    </if>
                    <if test="tContractAutoLog.phone != null and tContractAutoLog.phone.trim() != ''">
                        AND a.PHONE = #{tContractAutoLog.phone}
                    </if>
                    <if test="tContractAutoLog.errorInfo != null and tContractAutoLog.errorInfo.trim() != ''">
                        AND a.ERROR_INFO = #{tContractAutoLog.errorInfo}
                    </if>
                    <if test="tContractAutoLog.createBy != null and tContractAutoLog.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tContractAutoLog.createBy}
                    </if>
                    <if test="tContractAutoLog.updateBy != null and tContractAutoLog.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tContractAutoLog.updateBy}
                    </if>
                    <if test="tContractAutoLog.createName != null and tContractAutoLog.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tContractAutoLog.createName}
                    </if>
                    <if test="tContractAutoLog.updateTime != null">
                        AND a.UPDATE_TIME = #{tContractAutoLog.updateTime}
                    </if>
                    <if test="tContractAutoLog.createTime != null">
                        AND a.CREATE_TIME = #{tContractAutoLog.createTime}
                    </if>
        </if>
    </sql>
    <!--tContractAutoLog简单分页查询-->
    <select id="getTContractAutoLogPage" resultMap="tContractAutoLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_contract_auto_log a
        <where>
            1=1
            <include refid="tContractAutoLog_where"/>
        </where>
    </select>
</mapper>
