<?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="cn.pluss.platform.mapper.DeviceGoodsMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceGoods">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="name" property="name" />
        <result column="deviceLogo" property="deviceLogo" />
        <result column="introDesc" property="introDesc" />
        <result column="sort" property="sort" />
        <result column="status" property="status" />
        <result column="createTime" property="createTime" />
        <result column="updateTime" property="updateTime" />
    </resultMap>

    <select id="selectBySn" resultType="cn.pluss.platform.entity.DeviceGoods">
        SELECT * FROM tb_pluss_device_goods dg LEFT JOIN tb_pluss_device_stock ds
        ON dg.code = ds.code WHERE ds.snNo = #{snNo}
    </select>
</mapper>
