lxw
2023-06-21 707aeaa8d918c65c85c9eae480af08d13909494c
sop查询
1个文件已修改
11 ■■■■ 已修改文件
src/main/resources/mapper/SOPMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/SOPMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.SOPMapper">
    <resultMap id="sopList" type="sop">
    <resultMap id="sopList" type="SOP">
        <id property="id" column="id"></id>
        <result property="fileName" column="file_name"></result>
        <result property="fileType" column="file_type"></result>
@@ -14,17 +14,18 @@
        <result property="releaseNotes" column="release_notes"></result>
        <result property="createTime" column="create_time"></result>
        <result property="uploadUser" column="upload_user"></result>
        <collection property="sopProductList" ofType="sOPProduct">
            <id column="id" property="id"/>
        <collection property="sopProductList" ofType="SOPProduct">
            <id column="sid" property="id"/>
            <result column="code" property="code"/>
            <result column="model" property="model"/>
            <result column="sop_id" property="sopId"/>
        </collection>
    </resultMap>
    <select id="getSopInfo" resultMap="sopList">
        select * from tb_sop,tb_sop_product
        select *, tb_sop_product.id as sid from tb_sop
        LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id
        <where>
            tb_sop.id=tb_sop_product.sop_id
            1=1
            <if test="code!=null">
                and code LIKE '%${code}%'
            </if>