@Override
 public Pagination wildcardQuery(String type, int page, int pageSize) {
     StringBuffer hqlBuffer = new StringBuffer("from LawsAndRegulations where 1=1 and passAudit='"
             + LawsAndRegulations.PASS_AUDIT_YES + "'");
     if (!StringUtil.isNullOrEmpty(type)) {
         hqlBuffer.append(" and type = '").append(type).append("'");
     }
     hqlBuffer.append("order by releaseTime desc");
     return super.query(page, pageSize, hqlBuffer.toString());
 }
 @Override
 public String getVisibleIds(String type) {
     StringBuffer sql = new StringBuffer();
     sql.append("select t.id from T_LAWSANDREGULATIONS t where 1=1");
     sql.append(" and PASS_AUDIT='" + LawsAndRegulations.PASS_AUDIT_YES + "'");
     if (!StringUtil.isNullOrEmpty(type)) {
         sql.append(" and type = '").append(type).append("'");
     }
     List<?> lawsList = queryBySql(sql.toString());
     String queryIds = Util.spliceRangeIds(lawsList, null);
     return queryIds;
 }
    @Override
    public List<Background> wildcardQuery(Long backGroundImageId, String type) {

        StringBuffer hqlBuffer = new StringBuffer("from Background where 1 = 1");
        if (backGroundImageId != null) {
            hqlBuffer.append(" and backGroundImage.id = ").append(backGroundImageId);
        }
        if (!StringUtil.isNullOrEmpty(type)) {
            hqlBuffer.append(" and type like '%").append(type).append("%'");
        }

        return super.query(hqlBuffer.toString());
    }
    @Override
    public Pagination wildcardQuery(String releaseTime_begin, String releaseTime_end, String name, String type,
            int pageNo, int pageSize, String sort, String order) {

        StringBuffer hqlBuffer = new StringBuffer("from LawsAndRegulations where 1 = 1 and passAudit='"
                + LawsAndRegulations.PASS_AUDIT_YES + "'");

        if (!StringUtil.isNullOrEmpty(releaseTime_begin)) {
            hqlBuffer.append(" and releaseTime >= ").append("to_date('" + releaseTime_begin + "','yyyy-mm-dd')");
        }
        if (!StringUtil.isNullOrEmpty(releaseTime_end)) {
            hqlBuffer.append(" and releaseTime <= ").append("to_date('" + releaseTime_end + "','yyyy-mm-dd')");
        }

        if (!StringUtil.isNullOrEmpty(name)) {
            hqlBuffer.append(" and name like '%").append(name).append("%'");
        }
        if (!StringUtil.isNullOrEmpty(type)) {
            hqlBuffer.append(" and type = '").append(type).append("'");
        }

        return super.query(pageNo, pageSize, sort, order, hqlBuffer.toString());
    }
 /**
  * 取消或推荐信息
  * @param recomendtion
  * @param ids
  */
 private void recomend(String recomendtion, String ids) {
     if (!StringUtil.isNullOrEmpty(ids)) {
         Long[] longIds = ArrayUtils.convertStrLongArrayToInt(ids.split(","));
         for (Long id : longIds) {
             if(id > 0 ){
                 LawsAndRegulations laws = findById(id);
                 laws.setRecommendation(recomendtion);
                 if (BPMBasicEntity.RECOM_YES.equals(recomendtion)) {
                     laws.setRecommendTime(DateUtil.now());
                 }
                 modify(laws);
             }
         }
     }
 }