<?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.social.mapper.TAuditInfoMapper">

  <resultMap id="tAuditInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAuditInfo">
    <id property="id" column="ID"/>
    <result property="socialId" column="SOCIAL_ID"/>
    <result property="auditStatus" column="AUDIT_STATUS"/>
    <result property="auditRemark" column="AUDIT_REMARK"/>
    <result property="auditUser" column="AUDIT_USER"/>
    <result property="auditTime" column="AUDIT_TIME"/>
    <result property="isCommision" column="IS_COMMISION"/>
    <result property="providentId" column="PROVIDENT_ID"/>
    <result property="organName" column="ORGAN_NAME"/>
    <result property="title" column="TITLE"/>
    <result property="color" column="COLOR"/>
    <result property="dispatchInfoId" column="DISPATCH_INFO_ID"/>
    <result property="type" column="TYPE"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.SOCIAL_ID,
                a.AUDIT_STATUS,
                a.AUDIT_REMARK,
                a.AUDIT_USER,
                a.AUDIT_TIME,
                a.IS_COMMISION,
                a.PROVIDENT_ID,
                a.ORGAN_NAME,
                a.TITLE,
                a.COLOR,
                a.DISPATCH_INFO_ID,
                a.TYPE
    </sql>
    <sql id="tAuditInfo_where">
        <if test="tAuditInfo != null">
                    <if test="tAuditInfo.id != null and tAuditInfo.id.trim() != ''">
                        AND a.ID = #{tAuditInfo.id}
                    </if>
                    <if test="tAuditInfo.socialId != null and tAuditInfo.socialId.trim() != ''">
                        AND a.SOCIAL_ID = #{tAuditInfo.socialId}
                    </if>
                    <if test="tAuditInfo.auditStatus != null and tAuditInfo.auditStatus.trim() != ''">
                        AND a.AUDIT_STATUS = #{tAuditInfo.auditStatus}
                    </if>
                    <if test="tAuditInfo.auditRemark != null and tAuditInfo.auditRemark.trim() != ''">
                        AND a.AUDIT_REMARK = #{tAuditInfo.auditRemark}
                    </if>
                    <if test="tAuditInfo.auditUser != null and tAuditInfo.auditUser.trim() != ''">
                        AND a.AUDIT_USER = #{tAuditInfo.auditUser}
                    </if>
                    <if test="tAuditInfo.auditTime != null">
                        AND a.AUDIT_TIME = #{tAuditInfo.auditTime}
                    </if>
                    <if test="tAuditInfo.isCommision != null and tAuditInfo.isCommision.trim() != ''">
                        AND a.IS_COMMISION = #{tAuditInfo.isCommision}
                    </if>
                    <if test="tAuditInfo.providentId != null and tAuditInfo.providentId.trim() != ''">
                        AND a.PROVIDENT_ID = #{tAuditInfo.providentId}
                    </if>
                    <if test="tAuditInfo.dispatchInfoId != null and tAuditInfo.dispatchInfoId.trim() != ''">
                        AND a.DISPATCH_INFO_ID = #{tAuditInfo.dispatchInfoId}
                    </if>
                    <if test="tAuditInfo.type != null and tAuditInfo.type.trim() != ''">
                        AND a.TYPE = #{tAuditInfo.type}
                    </if>
        </if>
    </sql>
    <!--tAuditInfo简单分页查询-->
    <select id="getTAuditInfoPage" resultMap="tAuditInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_audit_info a
        <where>
            1=1
            <include refid="tAuditInfo_where"/>
        </where>
    </select>
</mapper>