|
|
@ -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 |
|
|
|
} |