| | |
| | | public interface WorksheetMainMapper extends CustomMapper<WorksheetMain> { |
| | | WorksheetMain getLinkList(int id); |
| | | |
| | | WorksheetMain getLinkListWithComponents(int id); |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private DocUser approvingUser; |
| | | |
| | | @ApiModelProperty("待审批散装件") |
| | | @TableField(exist = false) |
| | | private List<ComponentApproving> cApprovingList; |
| | | |
| | |
| | | } |
| | | |
| | | public WorksheetMain getLinkList(int id) { |
| | | return mainMapper.getLinkList(id); |
| | | //判断是哪种类型的审批,返回不同的类型 具体数据 |
| | | Integer type = getInfoById(id).getType(); |
| | | if(type.intValue() == EnumWorksheetType.ProductBom.getType()) { |
| | | return mainMapper.getLinkList(id); |
| | | }else if(type.intValue() == EnumWorksheetType.Component.getType()){ |
| | | return mainMapper.getLinkListWithComponents(id); |
| | | }else{ |
| | | //TODO |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<WorksheetMain>> getApprovingListPage(DocUser user, int pageNum, int pageSize) { |
| | |
| | | </resultMap> |
| | | <select id="getInfoList" resultMap="Map_WorksheetLink"> |
| | | SELECT |
| | | m.*, |
| | | 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,deal_user_id,deal_type,deal_desc,deal_reason,link_file,link_status,enable_archive,create_time,deal_time |
| | | FROM |
| | | db_doc.tb_worksheet_main m, |
| | |
| | | </select> |
| | | <select id="getInfoList2" resultMap="com.whyc.mapper.WorksheetMainMapper.Map_WorksheetMain"> |
| | | SELECT |
| | | m.id mid,m.* |
| | | 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 |
| | | FROM |
| | | db_doc.tb_worksheet_main m, |
| | | db_doc.tb_worksheet_link l |
| | |
| | | </select> |
| | | <select id="getInfoList3" resultMap="com.whyc.mapper.WorksheetMainMapper.Map_WorksheetMain"> |
| | | SELECT |
| | | m.id mid,m.*,l.deal_desc,l.deal_reason,l.deal_time |
| | | 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.deal_desc,l.deal_reason,l.deal_time |
| | | FROM |
| | | db_doc.tb_worksheet_main m, |
| | | db_doc.tb_worksheet_link l |
| | |
| | | <result column="level" property="level"/> |
| | | <result column="status" property="status"/> |
| | | <result column="end_reason" property="endReason"/> |
| | | <result column="type" property="type"/> |
| | | <result column="mType" property="type"/> |
| | | <association column="create_user_id" property="createUser" javaType="com.whyc.pojo.DocUser" select="getUser"> |
| | | <result column="name" property="name"/> |
| | | </association> |
| | |
| | | <result column="picture_url" property="pictureUrl"/> |
| | | <result column="file_url" property="fileUrl"/> |
| | | <result column="dwg_url" property="dwgUrl"/> |
| | | <result column="up_user" property="upUser"/> |
| | | <result column="create_date" property="createDate"/> |
| | | <result column="update_date" property="updateDate"/> |
| | | <result column="parent_version" property="parentVersion"/> |
| | | </collection> |
| | | <collection property="cApprovingList" ofType="ComponentApproving"> |
| | | <result column="type" property="type"/> |
| | | <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="unit" property="unit"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="producer" property="producer"/> |
| | | <result column="material" property="material"/> |
| | | <result column="thickness" property="thickness"/> |
| | | <result column="surface_detail" property="surfaceDetail"/> |
| | | <result column="notes" property="notes"/> |
| | | <result column="picture_url" property="pictureUrl"/> |
| | | <result column="file_url" property="fileUrl"/> |
| | | <result column="dwg_url" property="dwgUrl"/> |
| | | <result column="create_date" property="createDate"/> |
| | | <result column="update_date" property="updateDate"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | <select id="getUser" resultType="com.whyc.pojo.DocUser"> |
| | | select name from db_doc.tb_doc_user where id =#{user_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, |
| | | 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, |
| | | c.* |
| | | FROM |
| | | tb_worksheet_main m |
| | | LEFT JOIN |
| | | tb_worksheet_link l ON m.id = l.main_id |
| | | LEFT JOIN |
| | | tb_component_approving c ON m.id = c.main_id |
| | | WHERE |
| | | m.id = #{id} |
| | | </select> |
| | | </mapper> |