- 博客(13)
- 收藏
- 关注
原创 mybatis递归
public class IndustrialInfo { private String bigType; private List<Map> child; private String bigName; public String getBigType() { return bigType; } public void setBigType(String bigType) { this.bigType = b
2021-06-17 15:36:14
109
原创 验证字段是否重复
校验身份证号是否存在1.查询数据库中所以的身份证号//查询所有的身份证号List<CulturalTourismTalentInfo> tourismTalentInfos = culturalTourismTalentMapper.selectIdNumber();2.取出所有的身份证号字段//取出所有的身份证号字段List<String> idNumberList = tourismTalentInfos.stream().map(c -> c.getIdN
2021-06-11 14:29:45
262
2
原创 MySQL去除逗号分隔
语句:SELECT wid,substring_index(substring_index(unitType,’,’,c.help_topic_id+1),’,’,-1) AS unitType,chineseName FROM v_cultural_tourism_catalog_infojoin mysql.help_topic c on c.help_topic_id < (length(unitType) - length(replace(unitType,’,’,’’))+1)例如:表名
2021-05-17 17:17:39
1250
原创 时间格式转换
Date date = new Date(); //获取当前时间String nowDate = new SimpleDateFormat(“yyy-MM-dd”).format(date); //当前时间的格式Calendar cal = Calendar.getInstance();cal.add(Calendar.MONTH,-1); //获取到的当前时间减去一个月nowDate = new SimpleDateFormat(“yyy-MM-dd”).format(cal.getTime()
2021-03-24 14:32:17
245
原创 MySql添加一个自增的id列
MySql添加一个自增的id列@ROW:=@ROW+1 控制每次按几个递增(select @ROW := 0) TR 表示从第几位数字+1开始增加例:SELECT @ROW:=@ROW+1 as id,unitId,IF(num=‘无’,‘暂无’,num) AS num,complaintTime FROM tb_complaint_management_info,(select @ROW := 0) TR返回示例:...
2021-03-24 11:03:42
1452
原创 Format函数千分位转换和round函数保留小数位相结合
Format函数千分位转换和round函数保留小数位相结合Format(要转换的字段,0)format函数和round函数结合既可以千分位转换又可以保留小数位例:FORMAT(ROUND(4568.23,2),2)结果为:4,568.23
2021-01-08 15:26:53
1348
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人