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

  <resultMap id="tAutoContractRuleInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoContractRuleInfo">
    <id property="id" column="ID"/>
    <result property="autoFlag" column="AUTO_FLAG"/>
    <result property="newSignType" column="NEW_SIGN_TYPE"/>
    <result property="newSignDate" column="NEW_SIGN_DATE"/>
    <result property="confirmSignType" column="CONFIRM_SIGN_TYPE"/>
    <result property="confirmSignDate" column="CONFIRM_SIGN_DATE"/>
    <result property="renewalDateType" column="RENEWAL_DATE_TYPE"/>
    <result property="renewalDate" column="RENEWAL_DATE_"/>
    <result property="confirmEmpSelect" column="CONFIRM_EMP_SELECT"/>
    <result property="timeoutElecSign" column="TIMEOUT_ELEC_SIGN"/>
    <result property="signType" column="SIGN_TYPE"/>
    <result property="mainId" column="MAIN_ID"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="deptId" column="DEPT_ID"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.AUTO_FLAG,
                a.NEW_SIGN_TYPE,
                a.NEW_SIGN_DATE,
                a.CONFIRM_SIGN_TYPE,
                a.CONFIRM_SIGN_DATE,
                a.RENEWAL_DATE_TYPE,
                a.RENEWAL_DATE_,
                a.CONFIRM_EMP_SELECT,
                a.TIMEOUT_ELEC_SIGN,
                a.SIGN_TYPE,
                a.MAIN_ID,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_BY,
                a.UPDATE_TIME,
                a.DEPT_NO,
                a.DEPT_ID
    </sql>
    <sql id="tAutoContractRuleInfo_where">
        <if test="tAutoContractRuleInfo != null">
                    <if test="tAutoContractRuleInfo.id != null and tAutoContractRuleInfo.id.trim() != ''">
                        AND a.ID = #{tAutoContractRuleInfo.id}
                    </if>
                    <if test="tAutoContractRuleInfo.autoFlag != null and tAutoContractRuleInfo.autoFlag.trim() != ''">
                        AND a.AUTO_FLAG = #{tAutoContractRuleInfo.autoFlag}
                    </if>
                    <if test="tAutoContractRuleInfo.newSignType != null and tAutoContractRuleInfo.newSignType.trim() != ''">
                        AND a.NEW_SIGN_TYPE = #{tAutoContractRuleInfo.newSignType}
                    </if>
                    <if test="tAutoContractRuleInfo.newSignDate != null and tAutoContractRuleInfo.newSignDate.trim() != ''">
                        AND a.NEW_SIGN_DATE = #{tAutoContractRuleInfo.newSignDate}
                    </if>
                    <if test="tAutoContractRuleInfo.confirmSignType != null and tAutoContractRuleInfo.confirmSignType.trim() != ''">
                        AND a.CONFIRM_SIGN_TYPE = #{tAutoContractRuleInfo.confirmSignType}
                    </if>
                    <if test="tAutoContractRuleInfo.confirmSignDate != null and tAutoContractRuleInfo.confirmSignDate.trim() != ''">
                        AND a.CONFIRM_SIGN_DATE = #{tAutoContractRuleInfo.confirmSignDate}
                    </if>
                    <if test="tAutoContractRuleInfo.renewalDateType != null and tAutoContractRuleInfo.renewalDateType.trim() != ''">
                        AND a.RENEWAL_DATE_TYPE = #{tAutoContractRuleInfo.renewalDateType}
                    </if>
                    <if test="tAutoContractRuleInfo.renewalDate != null and tAutoContractRuleInfo.renewalDate.trim() != ''">
                        AND a.RENEWAL_DATE_ = #{tAutoContractRuleInfo.renewalDate}
                    </if>
                    <if test="tAutoContractRuleInfo.confirmEmpSelect != null and tAutoContractRuleInfo.confirmEmpSelect.trim() != ''">
                        AND a.CONFIRM_EMP_SELECT = #{tAutoContractRuleInfo.confirmEmpSelect}
                    </if>
                    <if test="tAutoContractRuleInfo.timeoutElecSign != null and tAutoContractRuleInfo.timeoutElecSign.trim() != ''">
                        AND a.TIMEOUT_ELEC_SIGN = #{tAutoContractRuleInfo.timeoutElecSign}
                    </if>
                    <if test="tAutoContractRuleInfo.signType != null and tAutoContractRuleInfo.signType.trim() != ''">
                        AND a.SIGN_TYPE = #{tAutoContractRuleInfo.signType}
                    </if>
                    <if test="tAutoContractRuleInfo.mainId != null and tAutoContractRuleInfo.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tAutoContractRuleInfo.mainId}
                    </if>
                    <if test="tAutoContractRuleInfo.createBy != null and tAutoContractRuleInfo.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tAutoContractRuleInfo.createBy}
                    </if>
                    <if test="tAutoContractRuleInfo.createName != null and tAutoContractRuleInfo.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tAutoContractRuleInfo.createName}
                    </if>
                    <if test="tAutoContractRuleInfo.createTime != null">
                        AND a.CREATE_TIME = #{tAutoContractRuleInfo.createTime}
                    </if>
                    <if test="tAutoContractRuleInfo.updateBy != null and tAutoContractRuleInfo.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tAutoContractRuleInfo.updateBy}
                    </if>
                    <if test="tAutoContractRuleInfo.updateTime != null">
                        AND a.UPDATE_TIME = #{tAutoContractRuleInfo.updateTime}
                    </if>
                    <if test="tAutoContractRuleInfo.deptNo != null and tAutoContractRuleInfo.deptNo.trim() != ''">
                        AND a.DEPT_NO = #{tAutoContractRuleInfo.deptNo}
                    </if>
                    <if test="tAutoContractRuleInfo.deptId != null and tAutoContractRuleInfo.deptId.trim() != ''">
                        AND a.DEPT_ID = #{tAutoContractRuleInfo.deptId}
                    </if>
        </if>
    </sql>
    <!--tAutoContractRuleInfo简单分页查询-->
    <select id="getTAutoContractRuleInfoPage" resultMap="tAutoContractRuleInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_auto_contract_rule_info a
        <where>
            1=1
            <include refid="tAutoContractRuleInfo_where"/>
        </where>
    </select>
</mapper>
