|
|
|
@ -3,10 +3,12 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.daoimpl;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.dao.IMesNcProcessingDao;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingPartAndLotModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
|
import javax.persistence.Query;
|
|
|
|
@ -89,4 +91,28 @@ public class MesNcProcessingDao implements IMesNcProcessingDao {
|
|
|
|
|
return modelList;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<String> queryPartInspectionCreateUser(String organizeCode, String createUserName) {
|
|
|
|
|
String sql = "SELECT DISTINCT(create_user) " +
|
|
|
|
|
"FROM mes_part_inspection " +
|
|
|
|
|
"WHERE is_valid = :isValid AND is_deleted = :isDeleted AND organize_code = :organizeCode ";
|
|
|
|
|
if (!StringUtils.isEmpty(createUserName)) {
|
|
|
|
|
sql += " AND create_user like :createUserName ";
|
|
|
|
|
}
|
|
|
|
|
Query query = entityManager.createNativeQuery(sql);
|
|
|
|
|
query.setParameter("isValid", CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
query.setParameter("isDeleted", CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
query.setParameter("organizeCode", organizeCode);
|
|
|
|
|
if (!StringUtils.isEmpty(createUserName)) {
|
|
|
|
|
query.setParameter("createUserName", createUserName + "%");
|
|
|
|
|
}
|
|
|
|
|
List resultList = query.getResultList();
|
|
|
|
|
if (CollectionUtils.isEmpty(resultList)) {
|
|
|
|
|
return null;
|
|
|
|
|
}else {
|
|
|
|
|
return (List<String>) resultList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|