package cn.hmsoft.mr.data.dao.cf; import org.springframework.stereotype.Repository; import cn.hmsoft.helper.StringHelper; import cn.hmsoft.jdbc.core.PlatformDaoSupport; import cn.hmsoft.jdbc.entity.Pager; import cn.hmsoft.jdbc.entity.QueryOrder; import cn.hmsoft.mr.data.model.cf.CfSchool; @Repository public class CfSchoolDao extends PlatformDaoSupport { public Pager pageSchool(Integer school_id, Integer start, Integer limit, String query, QueryOrder queryOrder) { StringBuilder sql = new StringBuilder(); sql.append("select * from cf_school b where 1=1 "); if (school_id != null) { sql.append(" and school_id=").append(school_id); } if (!StringHelper.isEmpty(query)) { sql.append(" and (b.batch_name like ?) "); String value = this.generateLikeParamter(query.trim()); return this.pageMapBySql(queryOrder, start, limit, sql.toString(), value); } else { return super.pageMapBySql(queryOrder, start, limit, sql.toString()); } } }