打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
layUi

通用实体

package com.aaa.util;/** * @Author: 0808 * @Date: 2020/7/13 0013 10:39 * @Version 1.0 * 常量类 */public class MyConstants {   /**保存操作*/    public static final String SAVE_OPERATION="save";    /**修改操作*/    public static final String UPDATE_OPERATION="update";    /**加密算法*/    public static final String ALGORITHM_NAME="MD5";    /**加密次数*/    public static final   int HASH_ITERATIONS=1000;    /** 操作成功信息 */    public static final String OPERATION_SUCCESS_MESSAGE="操作成功";    /** 操作成功代码 */    public static final int OPERATION_SUCCESS_CODE=0;    /** 操作失败信息 */    public static final String OPERATION_FAIL_MESSAGE="操作失败";    /** 操作失败代码 */    public static final int OPERATION_FAIL_CODE=1;    /** 柴油(大型加油站)阈值第一条数据 */    public static final int DIESELOIL_BIG=0;    /** 柴油(中型加油站)阈值第二条数据 */    public static final int DIESELOIL_BETWEEN=1;    /** 柴油(小型加油站)阈值第三条数据 */    public static final int DIESELOIL_SMALL=2;    /** 汽油(大型加油站)阈值第四条数据 */    public static final int GASOLINEOIL_BIG=3;    /** 汽油(中型加油站)阈值第五条数据 */    public static final int GASOLINEOIL_BETWEEN=4;    /** 汽油(小型加油站)阈值第六条数据 */    public static final int GASOLINEOIL_SMALL=5;    /** 变量为0的值 */    public static final int INTVALUE_ZERO=0;}

状态码

package com.cws.db_car.entity;import lombok.Data;import java.util.List;/** * @Author: 0808 * @Date: 2020/7/10 0010 16:10 * @Version 1.0 */@Datapublic class LayUiTable {    private int code;    private String msg;    private Integer count;    private List<?> data;}

查询&&模糊&&分页

    /**     * 查询所有汽车和模糊查询分页     * @param page     * @param limit     * @param searchTypename     * @return     */    @RequestMapping("/listCar")    @ResponseBody    public LayUiTable listCar(Integer page, Integer limit , String searchTypename) {        LayUiTable table = new LayUiTable();        //多条件查询所需要的集合        Map<String ,Object> condition= new HashMap(16);        Wrapper wrapper = new EntityWrapper();        //添加模糊查询的条件        if (null != searchTypename && !"".equals(searchTypename)) {            condition.put("typename", searchTypename);        }        int i = tCarService.selectCount(wrapper);        if(i>0){            //获取当前的系统毫秒数            Page<TCarVo> pageInfo = new Page(page, limit);            List<TCarVo> tCarVoList = tCarService.selectList(pageInfo, condition);            //从分页结果中提取list集合            table.setCode(MyConstants.OPERATION_SUCCESS_CODE);            table.setMsg(MyConstants.OPERATION_SUCCESS_MESSAGE);            table.setData(tCarVoList);            table.setCount(i);        }        return table;    }
来源:https://www.icode9.com/content-4-730701.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
设计模式-单例模式code
读取Guvnor中的规则...
Android源码之Parcel
Java基础之final关键字
SpringBoot统一返回结果
Spring Boot统一异常处理
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服