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

	<resultMap id="tAutoFundRuleInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoFundRuleInfo">
		<id property="id" column="ID"/>
		<result property="mainId" column="MAIN_ID"/>
		<result property="autoFlag" column="AUTO_FLAG"/>
		<result property="startPeriod" column="START_PERIOD"/>
		<result property="startTime" column="START_TIME"/>
		<result property="confirmPeriod" column="CONFIRM_PERIOD"/>
		<result property="confirmTime" column="CONFIRM_TIME"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="deptId" column="DEPT_ID"/>
		<result property="createTime" column="CREATE_TIME"/>
		<result property="updateTime" column="UPDATE_TIME"/>
		<result property="createBy" column="CREATE_BY"/>
		<result property="updateBy" column="UPDATE_BY"/>
		<result property="createName" column="CREATE_NAME"/>
	</resultMap>
	<sql id="Base_Column_List">
		a.ID,
		a.MAIN_ID,
		a.AUTO_FLAG,
		a.START_PERIOD,
		a.START_TIME,
		a.CONFIRM_PERIOD,
		a.CONFIRM_TIME,
		a.DEPT_NO,
		a.DEPT_ID,
		a.CREATE_TIME,
		a.UPDATE_TIME,
		a.CREATE_BY,
		a.UPDATE_BY,
		a.CREATE_NAME
	</sql>
	<sql id="tAutoFundRuleInfo_where">
		<if test="tAutoFundRuleInfo != null">
			<if test="tAutoFundRuleInfo.id != null and tAutoFundRuleInfo.id.trim() != ''">
				AND a.ID = #{tAutoFundRuleInfo.id}
			</if>
			<if test="tAutoFundRuleInfo.mainId != null and tAutoFundRuleInfo.mainId.trim() != ''">
				AND a.MAIN_ID = #{tAutoFundRuleInfo.mainId}
			</if>
			<if test="tAutoFundRuleInfo.autoFlag != null and tAutoFundRuleInfo.autoFlag.trim() != ''">
				AND a.AUTO_FLAG = #{tAutoFundRuleInfo.autoFlag}
			</if>
			<if test="tAutoFundRuleInfo.startPeriod != null and tAutoFundRuleInfo.startPeriod.trim() != ''">
				AND a.START_PERIOD = #{tAutoFundRuleInfo.startPeriod}
			</if>
			<if test="tAutoFundRuleInfo.startTime != null and tAutoFundRuleInfo.startTime.trim() != ''">
				AND a.START_TIME = #{tAutoFundRuleInfo.startTime}
			</if>
			<if test="tAutoFundRuleInfo.confirmPeriod != null and tAutoFundRuleInfo.confirmPeriod.trim() != ''">
				AND a.CONFIRM_PERIOD = #{tAutoFundRuleInfo.confirmPeriod}
			</if>
			<if test="tAutoFundRuleInfo.confirmTime != null and tAutoFundRuleInfo.confirmTime.trim() != ''">
				AND a.CONFIRM_TIME = #{tAutoFundRuleInfo.confirmTime}
			</if>
			<if test="tAutoFundRuleInfo.deptNo != null and tAutoFundRuleInfo.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tAutoFundRuleInfo.deptNo}
			</if>
			<if test="tAutoFundRuleInfo.deptId != null and tAutoFundRuleInfo.deptId.trim() != ''">
				AND a.DEPT_ID = #{tAutoFundRuleInfo.deptId}
			</if>
			<if test="tAutoFundRuleInfo.createTime != null">
				AND a.CREATE_TIME = #{tAutoFundRuleInfo.createTime}
			</if>
			<if test="tAutoFundRuleInfo.updateTime != null">
				AND a.UPDATE_TIME = #{tAutoFundRuleInfo.updateTime}
			</if>
			<if test="tAutoFundRuleInfo.createBy != null and tAutoFundRuleInfo.createBy.trim() != ''">
				AND a.CREATE_BY = #{tAutoFundRuleInfo.createBy}
			</if>
			<if test="tAutoFundRuleInfo.updateBy != null and tAutoFundRuleInfo.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tAutoFundRuleInfo.updateBy}
			</if>
			<if test="tAutoFundRuleInfo.createName != null and tAutoFundRuleInfo.createName.trim() != ''">
				AND a.CREATE_NAME = #{tAutoFundRuleInfo.createName}
			</if>
		</if>
	</sql>
	<!--tAutoFundRuleInfo简单分页查询-->
	<select id="getTAutoFundRuleInfoPage" resultMap="tAutoFundRuleInfoMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_auto_fund_rule_info a
		<where>
			1=1
			<include refid="tAutoFundRuleInfo_where"/>
		</where>
	</select>
</mapper>
