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

	<resultMap id="tAutoSocialRuleInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoSocialRuleInfo">
		<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,
	a.UPDATE_NAME
	</sql>
	<sql id="tAutoSocialRuleInfo_where">
		<if test="tAutoSocialRuleInfo != null">
			<if test="tAutoSocialRuleInfo.id != null and tAutoSocialRuleInfo.id.trim() != ''">
				AND a.ID = #{tAutoSocialRuleInfo.id}
			</if>
			<if test="tAutoSocialRuleInfo.mainId != null and tAutoSocialRuleInfo.mainId.trim() != ''">
				AND a.MAIN_ID = #{tAutoSocialRuleInfo.mainId}
			</if>
			<if test="tAutoSocialRuleInfo.autoFlag != null and tAutoSocialRuleInfo.autoFlag.trim() != ''">
				AND a.AUTO_FLAG = #{tAutoSocialRuleInfo.autoFlag}
			</if>
			<if test="tAutoSocialRuleInfo.startPeriod != null and tAutoSocialRuleInfo.startPeriod.trim() != ''">
				AND a.START_PERIOD = #{tAutoSocialRuleInfo.startPeriod}
			</if>
			<if test="tAutoSocialRuleInfo.startTime != null and tAutoSocialRuleInfo.startTime.trim() != ''">
				AND a.START_TIME = #{tAutoSocialRuleInfo.startTime}
			</if>
			<if test="tAutoSocialRuleInfo.confirmPeriod != null and tAutoSocialRuleInfo.confirmPeriod.trim() != ''">
				AND a.CONFIRM_PERIOD = #{tAutoSocialRuleInfo.confirmPeriod}
			</if>
			<if test="tAutoSocialRuleInfo.confirmTime != null and tAutoSocialRuleInfo.confirmTime.trim() != ''">
				AND a.CONFIRM_TIME = #{tAutoSocialRuleInfo.confirmTime}
			</if>
			<if test="tAutoSocialRuleInfo.deptNo != null and tAutoSocialRuleInfo.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tAutoSocialRuleInfo.deptNo}
			</if>
			<if test="tAutoSocialRuleInfo.deptId != null and tAutoSocialRuleInfo.deptId.trim() != ''">
				AND a.DEPT_ID = #{tAutoSocialRuleInfo.deptId}
			</if>
			<if test="tAutoSocialRuleInfo.createTime != null">
				AND a.CREATE_TIME = #{tAutoSocialRuleInfo.createTime}
			</if>
			<if test="tAutoSocialRuleInfo.updateTime != null">
				AND a.UPDATE_TIME = #{tAutoSocialRuleInfo.updateTime}
			</if>
			<if test="tAutoSocialRuleInfo.createBy != null and tAutoSocialRuleInfo.createBy.trim() != ''">
				AND a.CREATE_BY = #{tAutoSocialRuleInfo.createBy}
			</if>
			<if test="tAutoSocialRuleInfo.updateBy != null and tAutoSocialRuleInfo.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tAutoSocialRuleInfo.updateBy}
			</if>
			<if test="tAutoSocialRuleInfo.createName != null and tAutoSocialRuleInfo.createName.trim() != ''">
				AND a.CREATE_NAME = #{tAutoSocialRuleInfo.createName}
			</if>
			<if test="tAutoSocialRuleInfo.updateName != null and tAutoSocialRuleInfo.updateName.trim() != ''">
				AND a.UPDATE_NAME = #{tAutoSocialRuleInfo.updateName}
			</if>
		</if>
	</sql>
	<!--tAutoSocialRuleInfo简单分页查询-->
	<select id="getTAutoSocialRuleInfoPage" resultMap="tAutoSocialRuleInfoMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_auto_social_rule_info a
		<where>
			1=1
			<include refid="tAutoSocialRuleInfo_where"/>
		</where>
	</select>
</mapper>
