<?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.xingxi.mq.server.material.mapper.MaterialKindMqMapper">
    
    <resultMap type="MaterialKindMq" id="MaterialKindMqResult">
        <result property="mateKindId"    column="mateKindId"    />
        <result property="mercId"    column="mercId"    />
        <result property="mateBelong"    column="mateBelong"    />
        <result property="mateKindName"    column="mateKindName"    />
        <result property="vendorId"    column="vendorId"    />
        <result property="copyrightLicence"    column="copyrightLicence"    />
        <result property="auditStatus"    column="auditStatus"    />
        <result property="delFlag"    column="delFlag"    />
        <result property="createUser"    column="createUser"    />
        <result property="createTime"    column="createTime"    />
        <result property="updateUser"    column="updateUser"    />
        <result property="updateTime"    column="updateTime"    />

        <result property="mateId"    column="mateId"    />
    </resultMap>

    <sql id="selectMaterialKindMq">
        select
            m.mateKindId,
            m.mercId,
            m.mateBelong,
            m.mateKindName,
            m.vendorId,
            m.copyrightLicence,
            m.auditStatus,
            m.delFlag,
            m.createUser,
            m.createTime,
            m.updateUser,
            m.updateTime,
            f.mateId
            from m_material_kind m
                inner join m_material f on m.mateKindId = f.mateKindId
    </sql>

    <select id="selectMaterialKindMqByMateId" parameterType="Long" resultMap="MaterialKindMqResult">
        <include refid="selectMaterialKindMq"/>
        where f.mateId = #{mateId}
    </select>

</mapper>