whycxzp
2022-08-12 8b0df498c2b7cf978826c53da9a77958e0fff06d
更新审批
5个文件已修改
64 ■■■■■ 已修改文件
src/main/java/com/whyc/mapper/WorksheetMainMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/ComponentProductApproving.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/WorksheetMain.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetMainService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WorksheetMainMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/WorksheetMainMapper.java
@@ -7,4 +7,6 @@
    WorksheetMain getLinkListWithComponents(int id);
    WorksheetMain getLinkListWithComponentProducts(int id);
}
src/main/java/com/whyc/pojo/ComponentProductApproving.java
@@ -1,5 +1,6 @@
package com.whyc.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ibatis.type.Alias;
@@ -19,6 +20,9 @@
    private Integer linkType;
    @ApiModelProperty("主表id")
    private Integer mainId;
    @TableField(exist = false)
    private Component component;
    public Integer getId() {
        return id;
@@ -67,4 +71,12 @@
    public void setLinkType(Integer linkType) {
        this.linkType = linkType;
    }
    public Component getComponent() {
        return component;
    }
    public void setComponent(Component component) {
        this.component = component;
    }
}
src/main/java/com/whyc/pojo/WorksheetMain.java
@@ -71,6 +71,9 @@
    @TableField(exist = false)
    private List<ComponentApproving> cApprovingList;
    @TableField(exist = false)
    private List<ComponentProductApproving> cpApprovingList;
    public Integer getId() {
        return id;
    }
@@ -214,4 +217,12 @@
    public void setCApprovingList(List<ComponentApproving> cApprovingList) {
        this.cApprovingList = cApprovingList;
    }
    public List<ComponentProductApproving> getCpApprovingList() {
        return cpApprovingList;
    }
    public void setCpApprovingList(List<ComponentProductApproving> cpApprovingList) {
        this.cpApprovingList = cpApprovingList;
    }
}
src/main/java/com/whyc/service/WorksheetMainService.java
@@ -466,9 +466,8 @@
            return mainMapper.getLinkList(id);
        }else if(type.intValue() == EnumWorksheetType.Component.getType()){
            return mainMapper.getLinkListWithComponents(id);
        }else{
            //TODO
            return null;
        }else{ //散装件-产品
            return mainMapper.getLinkListWithComponentProducts(id);
        }
    }
src/main/resources/mapper/WorksheetMainMapper.xml
@@ -75,6 +75,23 @@
            <result column="update_date" property="updateDate"/>
        </collection>
    </resultMap>
    <resultMap id="Map_WorksheetMain2" type="WorksheetMain" extends="Map_WorksheetMain">
        <collection property="cpApprovingList" ofType="ComponentProductApproving">
            <result column="parent_model" property="parentModel" />
            <result column="sub_name" property="subName"/>
            <result column="link_type" property="linkType"/>
            <association column="component_id" property="component" javaType="Component" select="getComponent">
                <result column="category" property="category"/>
                <result column="sub_code" property="subCode"/>
                <result column="sub_name" property="subName"/>
                <result column="sub_model" property="subModel"/>
                <result column="quantity" property="quantity"/>
                <result column="unit" property="unit"/>
                <result column="producer" property="producer"/>
                <result column="notes" property="notes"/>
            </association>
        </collection>
    </resultMap>
    <select id="getLinkList" resultMap="Map_WorksheetMain">
        SELECT
@@ -94,6 +111,9 @@
    <select id="getUser" resultType="com.whyc.pojo.DocUser">
        select name from db_doc.tb_doc_user where id =#{user_id}
    </select>
    <select id="getComponent" resultType="Component">
        select category,sub_code,sub_name,sub_model,unit,quantity,producer,notes from db_doc.tb_component where id =#{component_id}
    </select>
    <select id="getLinkListWithComponents" resultMap="Map_WorksheetMain">
        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,
@@ -108,4 +128,18 @@
        WHERE
        m.id = #{id}
    </select>
    <select id="getLinkListWithComponentProducts" resultMap="Map_WorksheetMain2">
        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.*
        FROM
        tb_worksheet_main m
        LEFT JOIN
        tb_worksheet_link l ON m.id = l.main_id
        LEFT JOIN
        tb_component_product_approving cp ON m.id = cp.main_id
        WHERE
        m.id = #{id}
    </select>
</mapper>