Browse Source

添加通过车型配置id查找生成serialOrder的产品总成

pull/73/head
zhangxin 3 years ago
parent
commit
1231c18722
2 changed files with 43 additions and 0 deletions
  1. +21
    -0
      dao/me/ProductFamilyRelate.dao.go
  2. +22
    -0
      dao/me/implments/ProductFamilyRelate.dao.impl.go

+ 21
- 0
dao/me/ProductFamilyRelate.dao.go View File

@ -246,6 +246,27 @@ type ProductFamilyRelateDAO interface {
*
******************************************************************************/
SelectProductByFamilyId(projectId string, familyId string) ([]model.Product, error)
/******************************************************************************
*
* @Function Name : SelectProductByFamilyIdForCreateSerialOrder
*-----------------------------------------------------------------------------
*
* @Description : 通过项目ID和配置ID查询所有绑定的产品
*
* @Function Parameters : 项目ID
*
* @Function Parameters : 配置ID
*
* @Return Value : []model.Product
*
* @Return Value :执行时发生的错误
*
* @Author : zhangxin
*
* @Date : 2021-12-08
*
******************************************************************************/
SelectProductByFamilyIdForCreateSerialOrder(projectId string, familyId string) ([]model.Product, error)
}
/******************************************************************************


+ 22
- 0
dao/me/implments/ProductFamilyRelate.dao.impl.go View File

@ -326,3 +326,25 @@ func (impl *ProductFamilyRelateDAOImplement) SelectProductByFamilyId(projectId s
err := impl.session.Table(impl.meta.TableName).Join("LEFT", meta.Product.TableName, condition).Where(where, parameters...).OrderBy(meta.ProductFamilyRelate_Pos.SortColumnName).Find(&result)
return result, err
}
/******************************************************************************
*
* @Reference LAPP_ACURA_MOM_BACKEND/dao/me/ProductFamilyRelateDAO.SelectProductByFamilyId
*
******************************************************************************/
func (impl *ProductFamilyRelateDAOImplement) SelectProductByFamilyIdForCreateSerialOrder(projectId string, familyId string) ([]model.Product, error) {
result := make([]model.Product, 0, 4)
parameters := []interface{}{impl.plantNr, projectId, familyId, true}
where := fmt.Sprintf("%s = ? and %s = ? and %s = ? and %s = ?",
meta.ProductFamilyRelate_PlantNr.ColumnName,
meta.ProductFamilyRelate_ProjectId.ColumnName,
meta.ProductFamilyRelate_ProductFamilyId.ColumnName,
meta.Product_CreateWorkOrderToggle.ColumnName)
condition := fmt.Sprintf("%s = %s and %s = %s",
meta.ProductFamilyRelate_PlantNr.ColumnName,
meta.Product_PlantNr.ColumnName,
meta.ProductFamilyRelate_ProductId.ColumnName,
meta.Product_ProductId.ColumnName)
err := impl.session.Table(impl.meta.TableName).Join("LEFT", meta.Product.TableName, condition).Where(where, parameters...).OrderBy(meta.ProductFamilyRelate_Pos.SortColumnName).Find(&result)
return result, err
}

Loading…
Cancel
Save