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

  <resultMap id="tAutoInsurRuleInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoInsurRuleInfo">
    <id property="id" column="ID"/>
    <result property="autoFlag" column="AUTO_FLAG"/>
    <result property="addType" column="ADD_TYPE"/>
    <result property="updateType" column="UPDATE_TYPE"/>
    <result property="reduceType" column="REDUCE_TYPE"/>
    <result property="addAutoType" column="ADD_AUTO_TYPE"/>
    <result property="addAutoDate" column="ADD_AUTO_DATE"/>
    <result property="addStartDate" column="ADD_START_DATE"/>
    <result property="updateAutoType" column="UPDATE_AUTO_TYPE"/>
    <result property="updateAutoDate" column="UPDATE_AUTO_DATE"/>
    <result property="updateStartDate" column="UPDATE_START_DATE"/>
    <result property="reduceAutoType" column="REDUCE_AUTO_TYPE"/>
    <result property="reduceAutoDate" column="REDUCE_AUTO_DATE"/>
    <result property="reduceStartDate" column="REDUCE_START_DATE"/>
    <result property="mainId" column="MAIN_ID"/>
    <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="renewalPeriod" column="RENEWAL_PERIOD"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.AUTO_FLAG,
                a.ADD_TYPE,
                a.UPDATE_TYPE,
                a.REDUCE_TYPE,
                a.ADD_AUTO_TYPE,
                a.ADD_AUTO_DATE,
                a.ADD_START_DATE,
                a.UPDATE_AUTO_TYPE,
                a.UPDATE_AUTO_DATE,
                a.UPDATE_START_DATE,
                a.REDUCE_AUTO_TYPE,
                a.REDUCE_AUTO_DATE,
                a.REDUCE_START_DATE,
                a.MAIN_ID,
                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.RENEWAL_PERIOD
    </sql>
    <sql id="tAutoInsurRuleInfo_where">
        <if test="tAutoInsurRuleInfo != null">
                    <if test="tAutoInsurRuleInfo.id != null and tAutoInsurRuleInfo.id.trim() != ''">
                        AND a.ID = #{tAutoInsurRuleInfo.id}
                    </if>
                    <if test="tAutoInsurRuleInfo.autoFlag != null">
                        AND a.AUTO_FLAG = #{tAutoInsurRuleInfo.autoFlag}
                    </if>
                    <if test="tAutoInsurRuleInfo.addType != null">
                        AND a.ADD_TYPE = #{tAutoInsurRuleInfo.addType}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateType != null">
                        AND a.UPDATE_TYPE = #{tAutoInsurRuleInfo.updateType}
                    </if>
                    <if test="tAutoInsurRuleInfo.reduceType != null">
                        AND a.REDUCE_TYPE = #{tAutoInsurRuleInfo.reduceType}
                    </if>
                    <if test="tAutoInsurRuleInfo.addAutoType != null">
                        AND a.ADD_AUTO_TYPE = #{tAutoInsurRuleInfo.addAutoType}
                    </if>
                    <if test="tAutoInsurRuleInfo.addAutoDate != null and tAutoInsurRuleInfo.addAutoDate.trim() != ''">
                        AND a.ADD_AUTO_DATE = #{tAutoInsurRuleInfo.addAutoDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.addStartDate != null">
                        AND a.ADD_START_DATE = #{tAutoInsurRuleInfo.addStartDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateAutoType != null">
                        AND a.UPDATE_AUTO_TYPE = #{tAutoInsurRuleInfo.updateAutoType}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateAutoDate != null and tAutoInsurRuleInfo.updateAutoDate.trim() != ''">
                        AND a.UPDATE_AUTO_DATE = #{tAutoInsurRuleInfo.updateAutoDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateStartDate != null">
                        AND a.UPDATE_START_DATE = #{tAutoInsurRuleInfo.updateStartDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.reduceAutoType != null">
                        AND a.REDUCE_AUTO_TYPE = #{tAutoInsurRuleInfo.reduceAutoType}
                    </if>
                    <if test="tAutoInsurRuleInfo.reduceAutoDate != null and tAutoInsurRuleInfo.reduceAutoDate.trim() != ''">
                        AND a.REDUCE_AUTO_DATE = #{tAutoInsurRuleInfo.reduceAutoDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.reduceStartDate != null">
                        AND a.REDUCE_START_DATE = #{tAutoInsurRuleInfo.reduceStartDate}
                    </if>
                    <if test="tAutoInsurRuleInfo.mainId != null and tAutoInsurRuleInfo.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tAutoInsurRuleInfo.mainId}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateFlag != null">
                        AND a.UPDATE_FLAG = #{tAutoInsurRuleInfo.updateFlag}
                    </if>
                    <if test="tAutoInsurRuleInfo.createBy != null and tAutoInsurRuleInfo.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tAutoInsurRuleInfo.createBy}
                    </if>
                    <if test="tAutoInsurRuleInfo.createName != null and tAutoInsurRuleInfo.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tAutoInsurRuleInfo.createName}
                    </if>
                    <if test="tAutoInsurRuleInfo.createTime != null">
                        AND a.CREATE_TIME = #{tAutoInsurRuleInfo.createTime}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateBy != null and tAutoInsurRuleInfo.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tAutoInsurRuleInfo.updateBy}
                    </if>
                    <if test="tAutoInsurRuleInfo.updateTime != null">
                        AND a.UPDATE_TIME = #{tAutoInsurRuleInfo.updateTime}
                    </if>
					<if test="tAutoInsurRuleInfo.deptNo != null and tAutoInsurRuleInfo.deptNo.trim() != ''">
						AND a.DEPT_NO = #{tAutoEmpRuleInfo.deptNo}
					</if>
					<if test="tAutoInsurRuleInfo.deptId != null and tAutoInsurRuleInfo.deptId.trim() != ''">
						AND a.DEPT_ID = #{tAutoEmpRuleInfo.deptId}
					</if>
					<if test="tAutoInsurRuleInfo.renewalPeriod != null and tAutoInsurRuleInfo.renewalPeriod.trim() != ''">
						AND a.RENEWAL_PERIOD = #{tAutoEmpRuleInfo.renewalPeriod}
					</if>
        </if>
    </sql>
    <!--tAutoInsurRuleInfo简单分页查询-->
    <select id="getTAutoInsurRuleInfoPage" resultMap="tAutoInsurRuleInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_auto_insur_rule_info a
        <where>
            1=1
            <include refid="tAutoInsurRuleInfo_where"/>
        </where>
    </select>
</mapper>
