| | |
| | | import com.bstek.dorado.util.Assert; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.models.DicFoodOrigin; |
| | | import com.ld.igds.models.DicTrigger; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.RedisUtil; |
| | |
| | | hql += " order by code "; |
| | | return this.query(hql, args); |
| | | } |
| | | |
| | | @Override |
| | | public void pagFoodLocationData(Page<DicFoodOrigin> page, Map<String, Object> param) |
| | | throws Exception { |
| | | |
| | | String hql = " from " + DicFoodOrigin.class.getName() + " where 1=1"; |
| | | |
| | | Map<String, Object> args = new HashMap<String, Object>(); |
| | | |
| | | if (null != param) { |
| | | String str = (String) param.get("code"); |
| | | if (StringUtils.isNotEmpty(str)) { |
| | | hql += " and code like :code"; |
| | | args.put("code", "%" + str + "%"); |
| | | } |
| | | str = (String) param.get("name"); |
| | | if (StringUtils.isNotEmpty(str)) { |
| | | hql += " and name like :name"; |
| | | args.put("name", "%" + str + "%"); |
| | | } |
| | | |
| | | str = (String) param.get("disabledTag"); |
| | | if (StringUtils.isNotEmpty(str)) { |
| | | hql += " and disabledTag = :disabledTag"; |
| | | args.put("disabledTag", str); |
| | | } |
| | | |
| | | str = (String) param.get("key"); |
| | | if (StringUtils.isNoneEmpty(str)) { |
| | | hql += " and (name like :name or code like:code or simple like:simple) "; |
| | | args.put("name", "%" + str + "%"); |
| | | args.put("code", "%" + str + "%"); |
| | | args.put("simple", "%" + str.toUpperCase() + "%"); |
| | | } |
| | | } |
| | | |
| | | String coutHql = "select count(*) " + hql; |
| | | |
| | | hql += " order by sort"; |
| | | |
| | | if (args.isEmpty()) { |
| | | this.pagingQuery(page, hql, coutHql); |
| | | } else { |
| | | this.pagingQuery(page, hql, coutHql, args); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String copy2Target(String sourceId, String targetId) { |
| | | |