package cn.hmsoft.mr.data.dao.std; import cn.hmsoft.jdbc.entity.Pager; import cn.hmsoft.helper.StringHelper; import cn.hmsoft.jdbc.entity.QueryOrder; import org.springframework.stereotype.Repository; import cn.hmsoft.jdbc.core.PlatformDaoSupport; import cn.hmsoft.mr.data.model.std.StdLayout; /** * 数据库处理. * * @author: shudonghui * @date: 2023-07-19 13:44:53 * @version: 1.0 * @email: shudonghui@qmth.com.cn * @Company: www.hmsoft.cn */ @Repository public class StdLayoutDao extends PlatformDaoSupport { /** * 构建QueryOrder(order,type)过滤. * * @param query * @param start * @param limit * @param queryOrder * @param school_id * @param batch_id * @return */ public Pager page(String query, Integer start, Integer limit, QueryOrder queryOrder, Integer school_id, Integer batch_id) { String sql = "select * from std_layout where 1=1 "; // if (StringHelper.isEmpty(query)) { // return this.pageMapBySql(queryOrder, start, limit, sql); // } else { // return this.pageMapBySql(queryOrder, start, limit, // sql + "where 1 like ?", generateLikeParamter(query)); // } if (school_id != null) { sql += " and school_id=" + school_id; } if (batch_id != null) { sql += " and batch_id=" + batch_id; } if (!StringHelper.isEmpty(query)) { sql += " and (std_no 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()); } } }