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

  <resultMap id="tAutoFundRuleRelMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoFundRuleRel">
    <id property="id" column="ID"/>
    <result property="mainId" column="MAIN_ID"/>
    <result property="configName" column="CONFIG_NAME"/>
    <result property="configHouseId" column="CONFIG_HOUSE_ID"/>
    <result property="configHouseName" column="CONFIG_HOUSE_NAME"/>
    <result property="fundPerFlag" column="FUND_PER_FLAG"/>
    <result property="fundDateType" column="FUND_DATE_TYPE"/>
    <result property="paymentType" column="PAYMENT_TYPE"/>
    <result property="fundBase" column="FUND_BASE"/>
    <result property="fundCompanyPer" column="FUND_COMPANY_PER"/>
    <result property="fundPersonalPer" column="FUND_PERSONAL_PER"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="deptId" column="DEPT_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="province" column="PROVINCE"/>
    <result property="city" column="CITY"/>
    <result property="town" column="TOWN"/>
    <result property="upperLimit" column="UPPER_LIMIT"/>
    <result property="lowerLimit" column="LOWER_LIMIT"/>
  </resultMap>
    <sql id="Base_Column_List">
		a.ID,
		a.MAIN_ID,
		a.CONFIG_NAME,
		a.CONFIG_HOUSE_ID,
		a.CONFIG_HOUSE_NAME,
		a.FUND_PER_FLAG,
		a.FUND_DATE_TYPE,
		a.PAYMENT_TYPE,
		a.FUND_BASE,
		a.FUND_COMPANY_PER,
		a.FUND_PERSONAL_PER,
		a.DEPT_NO,
		a.DEPT_ID,
		a.CREATE_BY,
		a.CREATE_NAME,
		a.CREATE_TIME,
		a.UPDATE_BY,
		a.UPDATE_TIME,
		a.PROVINCE,
		a.CITY,
		a.TOWN,
		a.UPPER_LIMIT,
		a.LOWER_LIMIT
    </sql>
    <sql id="tAutoFundRuleRel_where">
        <if test="tAutoFundRuleRel != null">
                    <if test="tAutoFundRuleRel.id != null and tAutoFundRuleRel.id.trim() != ''">
                        AND a.ID = #{tAutoFundRuleRel.id}
                    </if>
                    <if test="tAutoFundRuleRel.mainId != null and tAutoFundRuleRel.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tAutoFundRuleRel.mainId}
                    </if>
                    <if test="tAutoFundRuleRel.configName != null and tAutoFundRuleRel.configName.trim() != ''">
                        AND a.CONFIG_NAME = #{tAutoFundRuleRel.configName}
                    </if>
                    <if test="tAutoFundRuleRel.configHouseId != null and tAutoFundRuleRel.configHouseId.trim() != ''">
                        AND a.CONFIG_HOUSE_ID = #{tAutoFundRuleRel.configHouseId}
                    </if>
                    <if test="tAutoFundRuleRel.configHouseName != null and tAutoFundRuleRel.configHouseName.trim() != ''">
                        AND a.CONFIG_HOUSE_NAME = #{tAutoFundRuleRel.configHouseName}
                    </if>
                    <if test="tAutoFundRuleRel.fundPerFlag != null and tAutoFundRuleRel.fundPerFlag.trim() != ''">
                        AND a.FUND_PER_FLAG = #{tAutoFundRuleRel.fundPerFlag}
                    </if>
                    <if test="tAutoFundRuleRel.fundDateType != null and tAutoFundRuleRel.fundDateType.trim() != ''">
                        AND a.FUND_DATE_TYPE = #{tAutoFundRuleRel.fundDateType}
                    </if>
                    <if test="tAutoFundRuleRel.paymentType != null and tAutoFundRuleRel.paymentType.trim() != ''">
                        AND a.PAYMENT_TYPE = #{tAutoFundRuleRel.paymentType}
                    </if>
                    <if test="tAutoFundRuleRel.fundBase != null">
                        AND a.FUND_BASE = #{tAutoFundRuleRel.fundBase}
                    </if>
                    <if test="tAutoFundRuleRel.fundCompanyPer != null and tAutoFundRuleRel.fundCompanyPer.trim() != ''">
                        AND a.FUND_COMPANY_PER = #{tAutoFundRuleRel.fundCompanyPer}
                    </if>
                    <if test="tAutoFundRuleRel.fundPersonalPer != null and tAutoFundRuleRel.fundPersonalPer.trim() != ''">
                        AND a.FUND_PERSONAL_PER = #{tAutoFundRuleRel.fundPersonalPer}
                    </if>
                    <if test="tAutoFundRuleRel.deptNo != null and tAutoFundRuleRel.deptNo.trim() != ''">
                        AND a.DEPT_NO = #{tAutoFundRuleRel.deptNo}
                    </if>
                    <if test="tAutoFundRuleRel.deptId != null and tAutoFundRuleRel.deptId.trim() != ''">
                        AND a.DEPT_ID = #{tAutoFundRuleRel.deptId}
                    </if>
                    <if test="tAutoFundRuleRel.createBy != null and tAutoFundRuleRel.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tAutoFundRuleRel.createBy}
                    </if>
                    <if test="tAutoFundRuleRel.createName != null and tAutoFundRuleRel.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tAutoFundRuleRel.createName}
                    </if>
                    <if test="tAutoFundRuleRel.createTime != null">
                        AND a.CREATE_TIME = #{tAutoFundRuleRel.createTime}
                    </if>
                    <if test="tAutoFundRuleRel.updateBy != null and tAutoFundRuleRel.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tAutoFundRuleRel.updateBy}
                    </if>
                    <if test="tAutoFundRuleRel.updateTime != null">
                        AND a.UPDATE_TIME = #{tAutoFundRuleRel.updateTime}
                    </if>
                    <if test="tAutoFundRuleRel.province != null">
                        AND a.PROVINCE = #{tAutoFundRuleRel.province}
                    </if>
                    <if test="tAutoFundRuleRel.city != null">
                        AND a.CITY = #{tAutoFundRuleRel.city}
                    </if>
                    <if test="tAutoFundRuleRel.town != null">
                        AND a.TOWN = #{tAutoFundRuleRel.town}
                    </if>
                    <if test="tAutoFundRuleRel.upperLimit != null">
                        AND a.UPPER_LIMIT = #{tAutoFundRuleRel.upperLimit}
                    </if>
                    <if test="tAutoFundRuleRel.lowerLimit != null">
                        AND a.LOWER_LIMIT = #{tAutoFundRuleRel.lowerLimit}
                    </if>
        </if>
    </sql>
    <!--tAutoFundRuleRel简单分页查询-->
    <select id="getTAutoFundRuleRelPage" resultMap="tAutoFundRuleRelMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_auto_fund_rule_rel a
        <where>
            1=1
            <include refid="tAutoFundRuleRel_where"/>
        </where>
    </select>
</mapper>
