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

  <resultMap id="tFascCompanyMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany">
    <id property="id" column="id"/>
    <result property="companyName" column="company_name"/>
    <result property="appId" column="app_id"/>
    <result property="openId" column="open_id"/>
    <result property="appSecret" column="app_secret"/>
    <result property="appUrl" column="app_url"/>
    <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="businessId" column="business_id"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.company_name,
                a.app_id,
                a.app_secret,
                a.app_url,
                a.open_id,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_BY,
                a.UPDATE_TIME,
                a.business_id
    </sql>
    <sql id="tFascCompany_where">
        <if test="tFascCompany != null">
                    <if test="tFascCompany.id != null and tFascCompany.id.trim() != ''">
                        AND a.id = #{tFascCompany.id}
                    </if>
                    <if test="tFascCompany.companyName != null and tFascCompany.companyName.trim() != ''">
                        AND a.company_name = #{tFascCompany.companyName}
                    </if>
                    <if test="tFascCompany.appId != null and tFascCompany.appId.trim() != ''">
                        AND a.app_id = #{tFascCompany.appId}
                    </if>
                    <if test="tFascCompany.appSecret != null and tFascCompany.appSecret.trim() != ''">
                        AND a.app_secret = #{tFascCompany.appSecret}
                    </if>
                    <if test="tFascCompany.appUrl != null and tFascCompany.appUrl.trim() != ''">
                        AND a.app_url = #{tFascCompany.appUrl}
                    </if>
                    <if test="tFascCompany.createBy != null and tFascCompany.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tFascCompany.createBy}
                    </if>
                    <if test="tFascCompany.createName != null and tFascCompany.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tFascCompany.createName}
                    </if>
                    <if test="tFascCompany.createTime != null">
                        AND a.CREATE_TIME = #{tFascCompany.createTime}
                    </if>
                    <if test="tFascCompany.updateBy != null and tFascCompany.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tFascCompany.updateBy}
                    </if>
                    <if test="tFascCompany.updateTime != null">
                        AND a.UPDATE_TIME = #{tFascCompany.updateTime}
                    </if>
        </if>
    </sql>
    <select id="getTFascCompanyAllList" resultMap="tFascCompanyMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_fasc_company a
        <where>
            1=1
            <include refid="tFascCompany_where"/>
        </where>
    </select>
</mapper>
