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

	<resultMap id="tAutoSocialRuleRelMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoSocialRuleRel">
		<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="socialDateFlag" column="SOCIAL_DATE_FLAG"/>
		<result property="socialDateType" column="SOCIAL_DATE_TYPE"/>
		<result property="paymentType" column="PAYMENT_TYPE"/>
		<result property="recordBaseType" column="RECORD_BASE_TYPE"/>
		<result property="recordBase" column="RECORD_BASE"/>
		<result property="remarkDict" column="REMARK_DICT"/>
		<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="upperLimit" column="UPPER_LIMIT"/>
		<result property="lowerLimit" column="LOWER_LIMIT"/>
		<result property="province" column="PROVINCE"/>
		<result property="city" column="CITY"/>
		<result property="town" column="TOWN"/>
		<result property="upPersion" column="UP_PERSION"/>
		<result property="upMedical" column="UP_MEDICAL"/>
		<result property="upUnemployment" column="UP_UNEMPLOYMENT"/>
		<result property="upInjury" column="UP_INJURY"/>
		<result property="upBirth" column="UP_BIRTH"/>
		<result property="upBig" column="UP_BIG"/>
		<result property="lowerPersion" column="LOWER_PERSION"/>
		<result property="lowerMedical" column="LOWER_MEDICAL"/>
		<result property="lowerUnemployment" column="LOWER_UNEMPLOYMENT"/>
		<result property="lowerInjury" column="LOWER_INJURY"/>
		<result property="lowerBirth" column="LOWER_BIRTH"/>
		<result property="lowerBig" column="LOWER_BIG"/>
	</resultMap>
	<sql id="Base_Column_List">
	a.ID,
	a.MAIN_ID,
	a.CONFIG_NAME,
	a.CONFIG_HOUSE_ID,
	a.SOCIAL_DATE_FLAG,
	a.SOCIAL_DATE_TYPE,
	a.PAYMENT_TYPE,
	a.RECORD_BASE_TYPE,
	a.RECORD_BASE,
	a.REMARK_DICT,
	a.DEPT_NO,
	a.DEPT_ID,
	a.CREATE_BY,
	a.CREATE_NAME,
	a.CREATE_TIME,
	a.UPDATE_BY,
	a.UPDATE_NAME,
	a.UPDATE_TIME,
	a.CONFIG_HOUSE_NAME,
	a.PROVINCE,
	a.CITY,
	a.TOWN,
	a.UPPER_LIMIT,
	a.LOWER_LIMIT,
	a.UP_PERSION,
	a.UP_MEDICAL,
	a.UP_UNEMPLOYMENT,
	a.UP_INJURY,
	a.UP_BIRTH,
	a.UP_BIG,
	a.LOWER_PERSION,
	a.LOWER_MEDICAL,
	a.LOWER_UNEMPLOYMENT,
	a.LOWER_INJURY,
	a.LOWER_BIRTH,
	a.LOWER_BIG
	</sql>
	<sql id="tAutoSocialRuleRel_where">
		<if test="tAutoSocialRuleRel != null">
			<if test="tAutoSocialRuleRel.id != null and tAutoSocialRuleRel.id.trim() != ''">
				AND a.ID = #{tAutoSocialRuleRel.id}
			</if>
			<if test="tAutoSocialRuleRel.mainId != null and tAutoSocialRuleRel.mainId.trim() != ''">
				AND a.MAIN_ID = #{tAutoSocialRuleRel.mainId}
			</if>
			<if test="tAutoSocialRuleRel.configName != null and tAutoSocialRuleRel.configName.trim() != ''">
				AND a.CONFIG_NAME = #{tAutoSocialRuleRel.configName}
			</if>
			<if test="tAutoSocialRuleRel.configHouseId != null and tAutoSocialRuleRel.configHouseId.trim() != ''">
				AND a.CONFIG_HOUSE_ID = #{tAutoSocialRuleRel.configHouseId}
			</if>
			<if test="tAutoSocialRuleRel.socialDateFlag != null and tAutoSocialRuleRel.socialDateFlag.trim() != ''">
				AND a.SOCIAL_DATE_FLAG = #{tAutoSocialRuleRel.socialDateFlag}
			</if>
			<if test="tAutoSocialRuleRel.socialDateType != null and tAutoSocialRuleRel.socialDateType.trim() != ''">
				AND a.SOCIAL_DATE_TYPE = #{tAutoSocialRuleRel.socialDateType}
			</if>
			<if test="tAutoSocialRuleRel.paymentType != null and tAutoSocialRuleRel.paymentType.trim() != ''">
				AND a.PAYMENT_TYPE = #{tAutoSocialRuleRel.paymentType}
			</if>
			<if test="tAutoSocialRuleRel.recordBaseType != null and tAutoSocialRuleRel.recordBaseType.trim() != ''">
				AND a.RECORD_BASE_TYPE = #{tAutoSocialRuleRel.recordBaseType}
			</if>
			<if test="tAutoSocialRuleRel.recordBase != null and tAutoSocialRuleRel.recordBase.trim() != ''">
				AND a.RECORD_BASE = #{tAutoSocialRuleRel.recordBase}
			</if>
			<if test="tAutoSocialRuleRel.remarkDict != null and tAutoSocialRuleRel.remarkDict.trim() != ''">
				AND a.REMARK_DICT = #{tAutoSocialRuleRel.remarkDict}
			</if>
			<if test="tAutoSocialRuleRel.deptNo != null and tAutoSocialRuleRel.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tAutoSocialRuleRel.deptNo}
			</if>
			<if test="tAutoSocialRuleRel.deptId != null and tAutoSocialRuleRel.deptId.trim() != ''">
				AND a.DEPT_ID = #{tAutoSocialRuleRel.deptId}
			</if>
			<if test="tAutoSocialRuleRel.createBy != null and tAutoSocialRuleRel.createBy.trim() != ''">
				AND a.CREATE_BY = #{tAutoSocialRuleRel.createBy}
			</if>
			<if test="tAutoSocialRuleRel.createName != null and tAutoSocialRuleRel.createName.trim() != ''">
				AND a.CREATE_NAME = #{tAutoSocialRuleRel.createName}
			</if>
			<if test="tAutoSocialRuleRel.createTime != null">
				AND a.CREATE_TIME = #{tAutoSocialRuleRel.createTime}
			</if>
			<if test="tAutoSocialRuleRel.updateBy != null and tAutoSocialRuleRel.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tAutoSocialRuleRel.updateBy}
			</if>
			<if test="tAutoSocialRuleRel.updateName != null and tAutoSocialRuleRel.updateName.trim() != ''">
				AND a.UPDATE_NAME = #{tAutoSocialRuleRel.updateName}
			</if>
			<if test="tAutoSocialRuleRel.updateTime != null">
				AND a.UPDATE_TIME = #{tAutoSocialRuleRel.updateTime}
			</if>
		</if>
	</sql>
	<!--tAutoSocialRuleRel简单分页查询-->
	<select id="getTAutoSocialRuleRelPage" resultMap="tAutoSocialRuleRelMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_auto_social_rule_rel a
		<where>
			1=1
			<include refid="tAutoSocialRuleRel_where"/>
		</where>
	</select>
</mapper>
