首页>代码>spring+Spring MVC+ MyBatis+apache shiro开发ssm网站后台权限管理系统>/easyee-sm/src/main/java/cn/easyproject/easyee/sm/base/pagination/EasyCriteria.java
package cn.easyproject.easyee.sm.base.pagination; import java.util.HashMap; import java.util.Map; /** * 按条件查询抽象父类(可以结合分页PageBean使用) * * SysUserCriteria Demo: <br> * * <pre><code> * public class SysUserCriteria extends EasyCriteria implements java.io.Serializable { * // 1. Criteria field * private String name; * private String realName; * private Integer status; // 0 is ON; 1 is OFF; 2 is REMOVED * * // 2. Constructor * public SysUserCriteria() { * } * * public SysUserCriteria(String name, String realName, Integer status) { * super(); * this.name = name; * this.realName = realName; * this.status = status; * } * * // 3. Condition genertator abstract method implements * public String getCondition() { * values.clear(); // **Must clear old values** * StringBuffer condition = new StringBuffer(); * if (StringUtils.isNotNullAndEmpty(this.getName())) { * condition.append(" and name like #{name}"); * values.put("name", "%" + this.getName() + "%"); * } * if (StringUtils.isNotNullAndEmpty(this.getRealName())) { * condition.append(" and realName like #{realName}"); * values.put("realName", "%" + this.getRealName() + "%"); * } * if (StringUtils.isNotNullAndEmpty(this.getStatus())) { * condition.append(" and status=#{status}"); * values.put("status" ,this.getStatus()); * } * return condition.toString(); * } * * // 4. Setters&Getters... * * } * </code></pre> * * @author Ray * @author inthinkcolor@gmail.com * @author easyproject.cn * @since 1.0.0 * @see https://github.com/ushelp/EasyMyBatisPagination * */ public abstract class EasyCriteria { protected Map<String, Object> values = new HashMap<String,Object>(); public abstract String getCondition(); public Map<String, Object> getValues() { return values; } public void setValues(Map<String, Object> values) { this.values = values; } }

wuying8208 LV15
2023年11月25日
vitos5n LV10
2022年9月13日
15827485252 LV19
2022年3月31日
00044304 LV6
2021年9月16日
jerywang LV9
2021年3月7日
一只勤奋的猪猪 LV9
2021年2月27日
ghost_M LV7
2021年1月7日
q59200182 LV9
2020年8月19日
13043860zj LV16
2020年8月10日
CSS199669 LV25
2020年7月23日

educationAAA LV11
2024年4月18日
xuweiwowzy LV5
2024年1月14日
gnnhka LV10
2023年12月26日
549472416
2023年12月7日
暂无贡献等级
wuying8208 LV15
2023年11月25日
马宇轩 LV1
2023年11月19日
oulingqiao LV13
2023年10月17日
空心菜4 LV9
2023年7月14日
sjl821120 LV6
2023年6月10日
森sdfgf LV8
2023年6月9日