<?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.njzscloud.dispose.mfg.craft.mapper.CraftMapper">

    <sql id="SearchCraftSql">
        SELECT a.id,
               a.sn,
               a.goods_id,
               a.craft_name,
               a.craft_ver,
               a.craft_category,
               a.canuse,
               a.memo,
               a.create_time,
               b.goods_name,
               b.sn AS goods_sn
        FROM mfg_craft a
                 INNER JOIN gds_goods b ON b.id = a.goods_id
    </sql>

    <select id="detail" resultType="com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult">
        <include refid="SearchCraftSql"/>
        WHERE a.id = #{id}
    </select>
    <select id="paging" resultType="com.njzscloud.dispose.mfg.craft.pojo.result.SearchCraftResult">
        <include refid="SearchCraftSql"/>
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>
