<?xml version="1.0" encoding="UTF-8"?>
<!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.business.mapper.system.TBusAttaInfoMapper">
    <resultMap id="tBusAttaInfoMap" type="com.yifu.cloud.plus.v1.business.entity.system.TBusAttaInfo">
        <id property="id" column="id"/>
        <result property="attaName" column="atta_name"/>
        <result property="attaSrc" column="atta_src"/>
        <result property="attaSize" column="atta_size"/>
        <result property="attaType" column="atta_type"/>
        <result property="createUserId" column="create_user_id"/>
        <result property="createUserName" column="create_user_name"/>
        <result property="createTime" column="create_time"/>
        <result property="relationId" column="relation_id"/>
        <result property="relationType" column="relation_type"/>
    </resultMap>
    <sql id="Base_Column_List">
        a.id,
        a.atta_name,
        a.atta_src,
        a.atta_size,
        a.atta_type,
        a.create_user_id,
        a.create_user_name,
        a.create_time,
        a.relation_id,
        a.relation_type
    </sql>
    <sql id="tBusAttaInfo_where">
        <if test="tBusAttaInfo != null">
            <if test="tBusAttaInfo.id != null and tBusAttaInfo.id.trim() != ''">
                AND a.id = #{tBusAttaInfo.id}
            </if>
            <if test="tBusAttaInfo.attaName != null and tBusAttaInfo.attaName.trim() != ''">
                AND a.atta_name = #{tBusAttaInfo.attaName}
            </if>
            <if test="tBusAttaInfo.attaSrc != null and tBusAttaInfo.attaSrc.trim() != ''">
                AND a.atta_src = #{tBusAttaInfo.attaSrc}
            </if>
            <if test="tBusAttaInfo.attaSize != null">
                AND a.atta_size = #{tBusAttaInfo.attaSize}
            </if>
            <if test="tBusAttaInfo.attaType != null and tBusAttaInfo.attaType.trim() != ''">
                AND a.atta_type = #{tBusAttaInfo.attaType}
            </if>
            <if test="tBusAttaInfo.createUserId != null and tBusAttaInfo.createUserId.trim() != ''">
                AND a.create_user_id = #{tBusAttaInfo.createUserId}
            </if>
            <if test="tBusAttaInfo.createUserName != null and tBusAttaInfo.createUserName.trim() != ''">
                AND a.create_user_name = #{tBusAttaInfo.createUserName}
            </if>
            <if test="tBusAttaInfo.createTime != null">
                AND a.create_time = #{tBusAttaInfo.createTime}
            </if>
            <if test="tBusAttaInfo.relationId != null and tBusAttaInfo.relationId.trim() != ''">
                AND a.relation_id = #{tBusAttaInfo.relationId}
            </if>
            <if test="tBusAttaInfo.relationType != null and tBusAttaInfo.relationType.trim() != ''">
                AND a.relation_type = #{tBusAttaInfo.relationType}
            </if>
        </if>
    </sql>
    <!--list-->
    <select id="getBusAttaList" resultMap="tBusAttaInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_atta_info a
        <where>
            1=1
            <include refid="tBusAttaInfo_where"/>
        </where>
    </select>
</mapper>
