<?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.ekp.mapper.EkpBudgetWarningInfoMapper">

	<resultMap id="ekpBudgetWarningInfoMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpBudgetWarningInfo">
		<id property="fdId" column="fd_id"/>
		<result property="fdContent" column="fd_content"/>
		<result property="fdCreateTime" column="fd_create_time"/>
		<result property="fdSubject" column="fd_subject"/>
		<result property="fdReadStatus" column="fd_read_status"/>
		<result property="fdRecipientName" column="fd_recipient_name"/>
		<result property="fdRecipientAccount" column="fd_recipient_account"/>
		<result property="fdRecipientId" column="fd_recipient_id"/>
	</resultMap>
	<sql id="Base_Column_List">
		a.fd_id,
        a.fd_content,
        a.fd_create_time,
        a.fd_subject,
        a.fd_read_status,
        a.fd_recipient_name,
        a.fd_recipient_account,
        a.fd_recipient_id
	</sql>
	<sql id="ekpBudgetWarningInfo_where">
		<if test="ekpBudgetWarningInfo != null">
			<if test="ekpBudgetWarningInfo.fdId != null and ekpBudgetWarningInfo.fdId.trim() != ''">
				AND a.fd_id = #{ekpBudgetWarningInfo.fdId}
			</if>
			<if test="ekpBudgetWarningInfo.fdContent != null and ekpBudgetWarningInfo.fdContent.trim() != ''">
				AND a.fd_content = #{ekpBudgetWarningInfo.fdContent}
			</if>
			<if test="ekpBudgetWarningInfo.fdCreateTime != null">
				AND a.fd_create_time = #{ekpBudgetWarningInfo.fdCreateTime}
			</if>
			<if test="ekpBudgetWarningInfo.fdSubject != null and ekpBudgetWarningInfo.fdSubject.trim() != ''">
				AND a.fd_subject = #{ekpBudgetWarningInfo.fdSubject}
			</if>
			<if test="ekpBudgetWarningInfo.fdReadStatus != null and ekpBudgetWarningInfo.fdReadStatus.trim() != ''">
				AND a.fd_read_status = #{ekpBudgetWarningInfo.fdReadStatus}
			</if>
			<if test="ekpBudgetWarningInfo.fdRecipientName != null and ekpBudgetWarningInfo.fdRecipientName.trim() != ''">
				AND a.fd_recipient_name = #{ekpBudgetWarningInfo.fdRecipientName}
			</if>
			<if test="ekpBudgetWarningInfo.fdRecipientAccount != null and ekpBudgetWarningInfo.fdRecipientAccount.trim() != ''">
				AND a.fd_recipient_account = #{ekpBudgetWarningInfo.fdRecipientAccount}
			</if>
			<if test="ekpBudgetWarningInfo.fdRecipientId != null and ekpBudgetWarningInfo.fdRecipientId.trim() != ''">
				AND a.fd_recipient_id = #{ekpBudgetWarningInfo.fdRecipientId}
			</if>
		</if>
	</sql>
	<!--ekpBudgetWarningInfo简单分页查询-->
	<select id="getEkpBudgetWarningInfoPage" resultMap="ekpBudgetWarningInfoMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM ekp_budget_warning_info a
		<where>
			1=1
			<include refid="ekpBudgetWarningInfo_where"/>
		</where>
	</select>
</mapper>
