07 2022 档案

摘要:LocalDateTime前后端传递转时间戳注解 @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) 实体类加上这两个注解的作用 阅读全文
posted @ 2022-07-22 15:42 阅读(858) 评论(0) 推荐(0) 编辑
摘要:@RequestMapping(value = "save", method = RequestMethod.POST) public R save(@RequestParam("imgFile") MultipartFile file) { String fileName = file.getOr 阅读全文
posted @ 2022-07-21 09:58 阅读(484) 评论(0) 推荐(0) 编辑
摘要:SELECT group_concat( concat( @j := IF ( @p = s.semester_id, @j + 1, IF ( @p := s.semester_id, 1, 1 ) ), '.', s.item ) SEPARATOR ', ' ) FirstName, s.* 阅读全文
posted @ 2022-07-21 09:57 阅读(248) 评论(0) 推荐(0) 编辑
摘要:1.生成随机数 (SELECT floor(rand()*100000000)) 2.sql查询字段值长度判断是否18位 SELECT * FROM 表名 WHERE LENGTH(字段)>=18 OR 字段为null IS NULL OR 字段为空=''; SELECT * FROM 表名 WHE 阅读全文
posted @ 2022-07-21 09:57 阅读(42) 评论(0) 推荐(0) 编辑
摘要:mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by在 [mysqld]和[mysql]下添加 sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DAT 阅读全文
posted @ 2022-07-21 09:56 阅读(24) 评论(0) 推荐(0) 编辑
摘要:SELECT -- COLUMN_NAME, -- _分割之后的第一段 concat( SUBSTRING_INDEX(LOWER(column_name), '_', 1), -- _分割之后的第二段 SUBSTR( UPPER(column_name), LENGTH( SUBSTRING_IN 阅读全文
posted @ 2022-07-21 08:58 阅读(340) 评论(0) 推荐(0) 编辑
摘要:场景: 1. 要查询数据库 "mammothcode" 下所有表名以及表注释 /* 查询数据库 ‘mammothcode’ 所有表注释 */ SELECT TABLE_NAME,TABLE_COMMENT FROM information_schema.TABLES WHERE table_sche 阅读全文
posted @ 2022-07-21 08:54 阅读(392) 评论(0) 推荐(0) 编辑
摘要:Mapper @Mapper public interface EmpMapper { /** * 查询所有的职工信息 */ List<Emp> getAllEmp(); /** * 查询职工及职工所对应的部门信息 */ Emp getEmpAndDept(@Param("eid") Integer 阅读全文
posted @ 2022-07-21 08:46 阅读(67) 评论(0) 推荐(0) 编辑
摘要:(一) mybatis-plus自带map下划线转驼峰配置类 我们只需要在yml中配置一下object-wrapper-factory指定MybatisMapWrapperFactory就可以了 mybatis-plus: mapper-locations: classpath:mapper/*Ma 阅读全文
posted @ 2022-07-21 08:45 阅读(1033) 评论(0) 推荐(0) 编辑
摘要:我这里提供的是mybatis plus 和 xml配置文件结合的方式:直接从service层开始写: service //这是service层,多表分页的简单逻辑处理,重点是IPage 和 Map, // IPage 就是分页,把分页的参数传进来进行使用 // Map 是用来传参数使用的,携带你需要 阅读全文
posted @ 2022-07-20 16:06 阅读(3389) 评论(1) 推荐(0) 编辑
摘要:@Mapper public interface DeptMapper { /** * 分步查询员工 * 及员工所对应的部门 * 分步查询第二步: * 通过部门查询员工所对应的部门 */ Dept getEmpAndDeptByTwo(@Param("did") Integer did); /** 阅读全文
posted @ 2022-07-20 16:06 阅读(60) 评论(0) 推荐(0) 编辑
摘要:RequestHttp.POST( "/charge/cost/sign/downLoadZip", para, "", `arraybuffer` //一定要写 ) .then(res => { console.info(res); var blob = new Blob([res.data], 阅读全文
posted @ 2022-07-20 11:32 阅读(540) 评论(0) 推荐(0) 编辑
摘要:集合转为数组 List<Long> chargeIds =new ArrayList<Long>(); Long [] ids=(Long[])chargeIds.toArray(); List<Map<String,Object>>转List<T> list map对象转list对象 List<M 阅读全文
posted @ 2022-07-20 11:31 阅读(1914) 评论(0) 推荐(0) 编辑
摘要:把返回类型(responseType: 'blob')写在接口定义的地方 studentchargeitemExport(params) { return axios({ url: `/charge-system/cs/cost/studentchargeitem/export`, response 阅读全文
posted @ 2022-07-18 14:39 阅读(169) 评论(0) 推荐(0) 编辑
摘要:java8中时间的各种转换(LocalDateTime) 1.将LocalDateTime转为自定义的时间格式的字符串 public static String getDateTimeAsString(LocalDateTime localDateTime, String format) { Dat 阅读全文
posted @ 2022-07-18 08:50 阅读(5302) 评论(0) 推荐(0) 编辑
摘要:以下为您演示MySQL常用的日期分组统计方法: 按月统计(一) SELECT date_format( r.pay_time, '%Y-%m' ) pay_time, r.pay_time, SUM( r.actual_payment ) AS actual_payment, r.org_id, r 阅读全文
posted @ 2022-07-18 08:50 阅读(1320) 评论(0) 推荐(0) 编辑
摘要:1多个用户同时操作数据库的同一条数据时候 场景(问题)描述如下: 0,用户A、B同时打开一个页面,页面显示,客户表T_user字段(nname、age)姓名:张三,年龄:25 1,A 将姓名“张三”改为“张三1”,然后保存 2,B 将年龄“25”改为“30”,然后保存 这样A的操作就被覆盖了,姓名又 阅读全文
posted @ 2022-07-14 14:03 阅读(53) 评论(0) 推荐(0) 编辑
摘要:/** * 四舍五入 * @param {数字} num * @param {保留小数位数} i * @returns */ export function rounded(num, i) { var total2 = 0; var yn = String(num).indexOf(".") + 1 阅读全文
posted @ 2022-07-14 11:12 阅读(37) 评论(0) 推荐(0) 编辑
摘要:List<Map<String, Object>> 去出重复 public static void main(String[] args) { String [] array= {"name","age"}; List<Map<String, Object>> oldList = getTestDa 阅读全文
posted @ 2022-07-13 08:48 阅读(597) 评论(0) 推荐(0) 编辑
摘要:/** * request转字符串 * @param request * @param charset 编码格式 (UTF-8) * @return * @see [类、类#方法、类#成员] */ public static String parseRequst(HttpServletRequest 阅读全文
posted @ 2022-07-13 08:48 阅读(258) 评论(0) 推荐(0) 编辑
摘要:1.集合中获取指定的一个属性值 List<String> items = li.stream().map(ScdCostChargeItemEntity::getItem).collect(Collectors.toList()); 2.集合分组 Map<String, List<T>> yearD 阅读全文
posted @ 2022-07-13 08:48 阅读(196) 评论(0) 推荐(0) 编辑
摘要:public class MenuTree1 { /** * 构建结束的树 */ private static List<Menu> menuList ; /** * 构建树 * @param menuId 树的根节点id 0:代表顶级节点 * @param nodeList 要构建的数据 * @r 阅读全文
posted @ 2022-07-12 16:41 阅读(72) 评论(0) 推荐(0) 编辑
摘要:@Test public void test10(){ //根据device_code去重,取出重复值 List<Employee> emps =new ArrayList<>(); List<String> dupList = emps.stream().collect(Collectors.gr 阅读全文
posted @ 2022-07-12 16:39 阅读(70) 评论(0) 推荐(0) 编辑
摘要:方式一: List<String> listTemp = new ArrayList<String>(); for(int i=0;i<list.size();i++){ if(!listTemp.contains(list.get(i))){ listTemp.add(list.get(i)); 阅读全文
posted @ 2022-07-12 16:39 阅读(355) 评论(0) 推荐(0) 编辑
摘要:@Test public void test12(){ // 需要过滤的集合 List<Employee> first = Arrays.asList( new Employee(102, "李四", 79, 6666.66, Status.BUSY), new Employee(101, "张三" 阅读全文
posted @ 2022-07-06 09:22 阅读(2797) 评论(0) 推荐(0) 编辑