|
|
@@ -5,6 +5,7 @@ import cn.hnthyy.thmz.entity.thmz.Config;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@@ -806,8 +807,16 @@ public class Tools {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- System.out.println(IdUtil.getSnowflake(2,2).nextIdStr());
|
|
|
- System.out.println(IdUtil.simpleUUID());
|
|
|
+ //String date1 = "2025-03-25 08:00:00";
|
|
|
+ //String date2 = "2025-03-25 08:00:00";
|
|
|
+ //System.out.println(DateUtil.parseDateTime(date1).getTime()==DateUtil.parseDateTime(date2).getTime());
|
|
|
+ //System.out.println(DateUtil.between(DateUtil.parseDateTime(date1),DateUtil.parseDateTime(date2), DateUnit.SECOND));
|
|
|
+
|
|
|
+ //System.out.println(IdUtil.getSnowflake(2,2).nextIdStr());
|
|
|
+ //System.out.println(IdUtil.simpleUUID());
|
|
|
+
|
|
|
+ getCamelCaseInsertSql("yz_zy_patient_fee","inpatient_no, admiss_times, ledger_sn, detail_sn, charge_date, op_id_code, charge_code, infant_flag, charge_status, charge_fee, occ_time, act_order_no, dept_code, ward_code, order_count, exec_unit, zy_serial_no, op_flag, op_id, op_date, yb_self_flag");
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* @description: 获取药品编码
|
|
|
@@ -847,4 +856,53 @@ public class Tools {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static void getCamelCaseInsertSql(String tableName,String underlineStr){
|
|
|
+ String[] split = underlineStr.split(",");
|
|
|
+ String startStr = "";
|
|
|
+
|
|
|
+ String str = "<script> insert into "+tableName + " ("+underlineStr+") values \n <foreach collection='list' item='item' separator=','> \n (";
|
|
|
+ for (int i = 0; i < split.length ; i++) {
|
|
|
+ if(i ==split.length-1 ){
|
|
|
+ str += "#{item." +toCamelCase(split[i]).trim()+"}";
|
|
|
+ }else {
|
|
|
+ str += "#{item." +toCamelCase(split[i]).trim()+"},";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ str += ")\n </foreach> \n </script>";
|
|
|
+
|
|
|
+ System.out.println(str);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下划线转驼峰
|
|
|
+ * @param underlineStr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String toCamelCase(String underlineStr) {
|
|
|
+ if (underlineStr == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ // 分成数组
|
|
|
+ char[] charArray = underlineStr.toCharArray();
|
|
|
+ // 判断上次循环的字符是否是"_"
|
|
|
+ boolean underlineBefore = false;
|
|
|
+ StringBuffer buffer = new StringBuffer();
|
|
|
+ for (int i = 0, l = charArray.length; i < l; i++) {
|
|
|
+ // 判断当前字符是否是"_",如果跳出本次循环
|
|
|
+ if (charArray[i] == 95) {
|
|
|
+ underlineBefore = true;
|
|
|
+ } else if (underlineBefore) {
|
|
|
+ // 如果为true,代表上次的字符是"_",当前字符需要转成大写
|
|
|
+ buffer.append(charArray[i] -= 32);
|
|
|
+ underlineBefore = false;
|
|
|
+ } else {
|
|
|
+ // 不是"_"后的字符就直接追加
|
|
|
+ buffer.append(charArray[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return buffer.toString();
|
|
|
+ }
|
|
|
+
|
|
|
}
|