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

  <resultMap id="tAutoEmpRuleInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoEmpRuleInfo">
    <id property="id" column="ID"/>
    <result property="autoFlag" column="AUTO_FLAG"/>
    <result property="collectType" column="COLLECT_TYPE"/>
	<result property="pushType" column="PUSH_TYPE"/>
    <result property="pushDate" column="PUSH_DATE"/>
    <result property="empType" column="EMP_TYPE"/>
    <result property="empProvince" column="EMP_PROVINCE"/>
    <result property="empCity" column="EMP_CITY"/>
    <result property="empTown" column="EMP_TOWN"/>
    <result property="contractType" column="CONTRACT_TYPE"/>
    <result property="businessTypeSub" column="BUSINESS_TYPE_SUB"/>
    <result property="updateFlag" column="UPDATE_FLAG"/>
    <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"/>
    <result property="mainId" column="MAIN_ID"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.AUTO_FLAG,
                a.COLLECT_TYPE,
                a.PUSH_DATE,
                a.EMP_TYPE,
                a.EMP_PROVINCE,
                a.EMP_CITY,
                a.EMP_TOWN,
                a.CONTRACT_TYPE,
                a.BUSINESS_TYPE_SUB,
                a.UPDATE_FLAG,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_BY,
                a.UPDATE_TIME,
                a.DEPT_NO,
                a.DEPT_ID,
                a.MAIN_ID,a.PUSH_TYPE
    </sql>
    <sql id="tAutoEmpRuleInfo_where">
        <if test="tAutoEmpRuleInfo != null">
                    <if test="tAutoEmpRuleInfo.id != null and tAutoEmpRuleInfo.id.trim() != ''">
                        AND a.ID = #{tAutoEmpRuleInfo.id}
                    </if>
                    <if test="tAutoEmpRuleInfo.autoFlag != null and tAutoEmpRuleInfo.autoFlag.trim() != ''">
                        AND a.AUTO_FLAG = #{tAutoEmpRuleInfo.autoFlag}
                    </if>
                    <if test="tAutoEmpRuleInfo.collectType != null and tAutoEmpRuleInfo.collectType.trim() != ''">
                        AND a.COLLECT_TYPE = #{tAutoEmpRuleInfo.collectType}
                    </if>
                    <if test="tAutoEmpRuleInfo.pushDate != null">
                        AND a.PUSH_DATE = #{tAutoEmpRuleInfo.pushDate}
                    </if>
                    <if test="tAutoEmpRuleInfo.empType != null and tAutoEmpRuleInfo.empType.trim() != ''">
                        AND a.EMP_TYPE = #{tAutoEmpRuleInfo.empType}
                    </if>
                    <if test="tAutoEmpRuleInfo.empProvince != null and tAutoEmpRuleInfo.empProvince.trim() != ''">
                        AND a.EMP_PROVINCE = #{tAutoEmpRuleInfo.empProvince}
                    </if>
                    <if test="tAutoEmpRuleInfo.empCity != null and tAutoEmpRuleInfo.empCity.trim() != ''">
                        AND a.EMP_CITY = #{tAutoEmpRuleInfo.empCity}
                    </if>
                    <if test="tAutoEmpRuleInfo.empTown != null and tAutoEmpRuleInfo.empTown.trim() != ''">
                        AND a.EMP_TOWN = #{tAutoEmpRuleInfo.empTown}
                    </if>
                    <if test="tAutoEmpRuleInfo.contractType != null and tAutoEmpRuleInfo.contractType.trim() != ''">
                        AND a.CONTRACT_TYPE = #{tAutoEmpRuleInfo.contractType}
                    </if>
                    <if test="tAutoEmpRuleInfo.businessTypeSub != null and tAutoEmpRuleInfo.businessTypeSub.trim() != ''">
                        AND a.BUSINESS_TYPE_SUB = #{tAutoEmpRuleInfo.businessTypeSub}
                    </if>
                    <if test="tAutoEmpRuleInfo.updateFlag != null and tAutoEmpRuleInfo.updateFlag.trim() != ''">
                        AND a.UPDATE_FLAG = #{tAutoEmpRuleInfo.updateFlag}
                    </if>
                    <if test="tAutoEmpRuleInfo.createBy != null and tAutoEmpRuleInfo.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tAutoEmpRuleInfo.createBy}
                    </if>
                    <if test="tAutoEmpRuleInfo.createName != null and tAutoEmpRuleInfo.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tAutoEmpRuleInfo.createName}
                    </if>
                    <if test="tAutoEmpRuleInfo.createTime != null">
                        AND a.CREATE_TIME = #{tAutoEmpRuleInfo.createTime}
                    </if>
                    <if test="tAutoEmpRuleInfo.updateBy != null and tAutoEmpRuleInfo.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tAutoEmpRuleInfo.updateBy}
                    </if>
                    <if test="tAutoEmpRuleInfo.updateTime != null">
                        AND a.UPDATE_TIME = #{tAutoEmpRuleInfo.updateTime}
                    </if>
                    <if test="tAutoEmpRuleInfo.deptNo != null and tAutoEmpRuleInfo.deptNo.trim() != ''">
                        AND a.DEPT_NO = #{tAutoEmpRuleInfo.deptNo}
                    </if>
                    <if test="tAutoEmpRuleInfo.deptId != null and tAutoEmpRuleInfo.deptId.trim() != ''">
                        AND a.DEPT_ID = #{tAutoEmpRuleInfo.deptId}
                    </if>
                    <if test="tAutoEmpRuleInfo.mainId != null and tAutoEmpRuleInfo.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tAutoEmpRuleInfo.mainId}
                    </if>
        </if>
    </sql>
    <!--tAutoEmpRuleInfo简单分页查询-->
    <select id="getTAutoEmpRuleInfoPage" resultMap="tAutoEmpRuleInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_auto_emp_rule_info a
        <where>
            1=1
            <include refid="tAutoEmpRuleInfo_where"/>
        </where>
    </select>
</mapper>
