whycxzp
2022-08-26 eb63ad5d6a206557590de9dcf619464518f2360d
更新
3个文件已修改
29 ■■■■ 已修改文件
src/main/java/com/whyc/mapper/WorksheetMainMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetMainService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WorksheetMainMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/WorksheetMainMapper.java
@@ -5,8 +5,8 @@
public interface WorksheetMainMapper extends CustomMapper<WorksheetMain> {
    WorksheetMain getLinkList(int id);
    WorksheetMain getLinkListWithComponents(int id);
    WorksheetMain getLinkListWithMaterials(int id);
    WorksheetMain getLinkListWithComponentProducts(int id);
    WorksheetMain getLinkListWithMaterialProducts(int id);
}
src/main/java/com/whyc/service/WorksheetMainService.java
@@ -648,12 +648,9 @@
        if(type.intValue() == EnumWorksheetType.ProductBom.getType()) {
            return mainMapper.getLinkList(id);
        }else if(type.intValue() == EnumWorksheetType.Material.getType()){
            //lxw注释
            //return mainMapper.getLinkListWithMaterials(id);
            return null;
            return mainMapper.getLinkListWithMaterials(id);
        }else{ //物料-产品
            //return mainMapper.getLinkListWithMaterialProducts(id);
            return null;
            return mainMapper.getLinkListWithMaterialProducts(id);
        }
    }
src/main/resources/mapper/WorksheetMainMapper.xml
@@ -93,11 +93,13 @@
    </resultMap>
    <resultMap id="Map_WorksheetMain4" type="WorksheetMain" extends="Map_WorksheetMain">
        <collection property="mpApprovingList" ofType="MaterialProductApproving">
           <!-- <result column="parent_model" property="parentModel" />
            <result column="sub_name" property="subName"/>
            <result column="parent_code" property="parentCode" />
            <result column="custom_code" property="customCode" />
            <result column="version" property="version"/>
            <result column="sub_code" property="subCode"/>
            <result column="link_type" property="linkType"/>
            <result column="material_id" property="MaterialId"/>
            <association column="material_id" property="Material" javaType="Material" select="getMaterial">
            <result column="material_id" property="materialId"/>
            <association column="material_id" property="material" javaType="Material" select="getMaterial">
                <result column="category" property="category"/>
                <result column="sub_code" property="subCode"/>
                <result column="sub_name" property="subName"/>
@@ -106,7 +108,7 @@
                <result column="unit" property="unit"/>
                <result column="producer" property="producer"/>
                <result column="notes" property="notes"/>
            </association>-->
            </association>
        </collection>
    </resultMap>
@@ -129,7 +131,7 @@
        select name from db_doc.tb_doc_user where id =#{user_id}
    </select>
    <select id="getMaterial" resultType="Material">
        select category,sub_code,sub_name,sub_model,unit,quantity,producer,notes from db_doc.tb_Material where id =#{material_id}
        select category,sub_code,sub_name,sub_model,unit,quantity,producer,notes from db_doc.tb_material where id =#{material_id}
    </select>
    <select id="getLinkListWithMaterials" resultMap="Map_WorksheetMain3">
        SELECT
@@ -149,13 +151,13 @@
        SELECT
        m.id mid,m.title,m.description,m.file,m.create_user_id,m.begin_time,m.end_time,m.level,m.status,m.end_reason,m.type mType,
        l.id lid,l.parent_id,deal_user_id,deal_type,deal_desc,deal_reason,link_file,link_status,enable_archive,create_time,deal_time,
        cp.*
        mp.*
        FROM
        tb_worksheet_main m
        LEFT JOIN
        tb_worksheet_link l ON m.id = l.main_id
        LEFT JOIN
        tb_Material_product_approving cp ON m.id = cp.main_id
        tb_material_product_approving mp ON m.id = mp.main_id
        WHERE
        m.id = #{id}
    </select>