|
|
@ -310,7 +310,7 @@ func (impl *ProductWorkLineLstDAOImplement) UpdateWhere(predicates []grmi.Predic |
|
|
|
* @Reference LAPP_ACURA_MOM_BACKEND/dao/me/ProductWorkLineLstDAOImplement.SelectByRelate |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func (impl *ProductWorkLineLstDAOImplement) SelectByRelate(workLineId string) ([]model.Product, error) { |
|
|
|
func (impl *ProductWorkLineLstDAOImplement) SelectByRelate(workLineId string, projectId string) ([]model.Product, error) { |
|
|
|
result := make([]model.Product, 0) |
|
|
|
condition := fmt.Sprintf("%s = %s and %s = %s and %s = %s", |
|
|
|
meta.Product_PlantNr.ColumnName, |
|
|
@ -325,6 +325,10 @@ func (impl *ProductWorkLineLstDAOImplement) SelectByRelate(workLineId string) ([ |
|
|
|
meta.ProductWorkLineLst_PlantNr.ColumnName, |
|
|
|
meta.ProductWorkLineLst_WorkLineId.ColumnName, |
|
|
|
meta.Product_MultiWorkLineToggle.ColumnName) |
|
|
|
if projectId != "" { |
|
|
|
where += fmt.Sprintf(" and %s = ? ", meta.ProductWorkLineLst_ProjectId.ColumnName) |
|
|
|
parameters = append(parameters, projectId) |
|
|
|
} |
|
|
|
err := session.Where(where, parameters...).OrderBy(meta.ProductWorkLineLst_ProductId.ColumnName).Find(&result) |
|
|
|
return result, err |
|
|
|
} |