CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
igds-core/src/main/java/com/ld/igds/view/service/HGranaryService.java
@@ -7,7 +7,6 @@
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Session;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@@ -24,27 +23,29 @@
            throws Exception {
        String hql = " from " + Granary.class.getName()
                + " where companyId=:companyId";
        Map<String, Object> args = new HashMap<String, Object>();
        args.put("companyId", ContextUtil.getCompanyId());
        if (null != param) {
            String str = (String) param.get("depotId");
            if (StringUtils.isNotEmpty(str)) {
                hql += " and cfbh =:depotId";
                args.put("depotId", str);
        if (null == param) {
            param = new HashMap<>();
            }
        String companyId = (String) param.get("companyId");
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        Map<String, Object> args = new HashMap<String, Object>();
        args.put("companyId", companyId);
        String str = (String) param.get("deptId");
        if (StringUtils.isNotEmpty(str)) {
            hql += " and deptId =:deptId";
            args.put("deptId", str);
        }
            str = (String) param.get("name");
            if (StringUtils.isNotEmpty(str)) {
                hql += " and ajmc like:name";
                args.put("name", "%" + str + "%");
            }
        }
        String count = "select count(*) " + hql;
        hql += " order by  updateTime desc";
        this.pagingQuery(page, hql, count, args);