fix: 修复数据库时间类型,基础数据jzh判断规则,用户、科室插入和修改的List判断

master
wyb 1 year ago
parent 7a09ba0908
commit d0eccd0f27

@ -1,19 +1,12 @@
package com.docus.server;
import cn.hutool.extra.spring.SpringUtil;
import com.docus.server.archive.entity.TBasic;
import com.docus.server.archive.mapper.TBasicMapper;
import com.docus.server.archive.utils.PinYinUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.BeanUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import java.util.Arrays;
import java.util.Date;
import java.util.Properties;
@ -35,49 +28,7 @@ public class AppRunBootstrap {
}
static void testMysql(){
TBasicMapper mapper = SpringUtil.getBean(TBasicMapper.class);
long currentTimeMillis = System.currentTimeMillis();
TBasic tBasic1 = new TBasic();
tBasic1.setPatientId("FS-TEST-1");
tBasic1.setJzh("jzh"+ currentTimeMillis);
tBasic1.setInpatientNo(currentTimeMillis +"");
tBasic1.setAdmissTimes(1);
tBasic1.setName("佛山测试1");
tBasic1.setNameSpell(PinYinUtil.getFirstSpell("佛山测试1"));
tBasic1.setSex("1");
tBasic1.setSexName("男");
tBasic1.setAdmissDate(new Date());
tBasic1.setAdmissDept("221");
tBasic1.setAdmissDeptName("神经内科");
tBasic1.setBedNo("神经内科1-1");
tBasic1.setAttending("wyb");
tBasic1.setAttendingName("文永斌");
tBasic1.setAge(50);
tBasic1.setAgeMonth(12);
tBasic1.setAgeDay(3);
tBasic1.setIdCard("xxxxxx");
tBasic1.setTelphone("666");
tBasic1.setDisDate(new Date());
tBasic1.setDisDept("221");
tBasic1.setDisDeptName("神经内科");
tBasic1.setTotalCost("28.8");
tBasic1.setIsDead(0);
tBasic1.setJzCardNo("kh1998");
tBasic1.setFileSource(1);
tBasic1.setCreateTime(new Date());
tBasic1.setUpdateTime(new Date());
TBasic tBasic2 = new TBasic();
BeanUtils.copyProperties(tBasic1,tBasic2);
tBasic2.setPatientId("FS-TEST-2");
tBasic2.setAdmissTimes(2);
tBasic2.setJzh("jzh"+(currentTimeMillis+555));
mapper.insertBatch(Arrays.asList(tBasic1,tBasic2));
System.out.println("插入后:"+mapper.getByJzh(Arrays.asList(tBasic1.getJzh(),tBasic2.getJzh())));
tBasic1.setIdCard("modify-1");
tBasic2.setIdCard("modify-2");
mapper.updateBatch(Arrays.asList(tBasic1,tBasic2));
System.out.println("修改后:"+mapper.getByJzh(Arrays.asList(tBasic1.getJzh(),tBasic2.getJzh())));
}
}

@ -81,11 +81,11 @@ public class ZqDyRyDeptInfoSyncServiceImpl implements DeptInfoSyncService {
iuPowerDept.setSort(0);
insertDeptList.add(iuPowerDept);
}
if (Func.isEmpty(insertDeptList)) {
if (Func.isNotEmpty(insertDeptList)) {
powerDeptMapper.insertBatch(insertDeptList);
}
if (Func.isEmpty(updateDeptList)) {
if (Func.isNotEmpty(updateDeptList)) {
powerDeptMapper.updateBatch(updateDeptList);
}

@ -82,7 +82,7 @@ public class ZqDyRyPatientInfoSyncServiceImpl implements PatientInfoSyncService
List<TBasic> insertBasicList = new ArrayList<>();
List<TBasic> updateBasicList = new ArrayList<>();
for (TBasic iuBasic : iuBasicList) {
String maybeJzh = iuBasic.getJzh().trim() + "@" + iuBasic.getAdmissTimes();
String maybeJzh = iuBasic.getInpatientNo().trim() + "@" + iuBasic.getAdmissTimes();
if (existsJzhBasicMap.containsKey(iuBasic.getJzh()) || existsJzhBasicMap.containsKey(maybeJzh)) {
TBasic basic1 = existsJzhBasicMap.get(iuBasic.getJzh());
TBasic basic2 = existsJzhBasicMap.get(maybeJzh);

@ -128,11 +128,11 @@ public class ZqDyRyUserInfoSyncServiceImpl implements UserInfoSyncService {
insertUserList.add(iuPowerUser);
}
if (Func.isEmpty(insertUserList)) {
if (Func.isNotEmpty(insertUserList)) {
powerUserMapper.insertBatch(insertUserList);
}
if (Func.isEmpty(updateUserList)) {
if (Func.isNotEmpty(updateUserList)) {
powerUserMapper.updateBatch(updateUserList);
}
}

@ -4,6 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.archive.mapper.PowerDeptMapper">
<insert id="insertBatch">
INSERT INTO docus_system.power_dept (dept_id, dept_code, dept_name, dict_id,
effective, create_date, creater, update_date,
updater, remark, sort, `type`)

@ -11,7 +11,7 @@
SELECT t.*,
ROWNUM rn
FROM MDIP.V_JSWZH_BASE_ZL t
WHERE LAST_MODIFIC_TIME BETWEEN TO_DATE(#{timeBegin}, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{timeEnd}, 'YYYY-MM-DD HH24:MI:SS')
WHERE TO_DATE(LAST_MODIFIC_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN TO_DATE(#{timeBegin}, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{timeEnd}, 'YYYY-MM-DD HH24:MI:SS')
) WHERE rn BETWEEN ${startRow} AND ${endRow}
</select>
</mapper>

Loading…
Cancel
Save