Browse Source

添加通过产线和项目查询总成

pull/240/head
zhangxin 2 years ago
parent
commit
79b1001161
2 changed files with 6 additions and 2 deletions
  1. +1
    -1
      dao/me/ProductWorkLineLst.dao.go
  2. +5
    -1
      dao/me/implments/ProductWorkLineLst.dao.impl.go

+ 1
- 1
dao/me/ProductWorkLineLst.dao.go View File

@ -239,7 +239,7 @@ type ProductWorkLineLstDAO interface {
* @Date : 2021-11-15
*
******************************************************************************/
SelectByRelate(workLineId string) ([]model.Product, error)
SelectByRelate(workLineId string, projectId string) ([]model.Product, error)
}
/******************************************************************************


+ 5
- 1
dao/me/implments/ProductWorkLineLst.dao.impl.go View File

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

Loading…
Cancel
Save