liusheng
2024-09-24 562a960261b75d70abd65aa10528f09aeece94e8
代码提交
已添加3个文件
已修改12个文件
1300 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SysUserImport.java 330 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/SysUserImportMapper.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceTaskService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml 621 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.smartor;
import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -47,7 +48,18 @@
    @PostMapping("/patItem")
    public TableDataInfo patItem(@RequestBody ServiceSubtask ivrTaskcall) {
        PageUtils.startPageByPost(ivrTaskcall.getPageNum(), ivrTaskcall.getPageSize());
        return getDataTable(serviceSubtaskService.patItem(ivrTaskcall));
        List<ServiceSubtask> serviceSubtaskList = serviceSubtaskService.patItem(ivrTaskcall);
        //获取total
        long total = PageUtils.count(new ISelect() {
            @Override
            public void doSelect() {
                ivrTaskcall.setPageNum(null);
                ivrTaskcall.setPageSize(null);
                serviceSubtaskService.patItem(ivrTaskcall);
            }
        });
        return getDataTable2(total, serviceSubtaskList);
//        return getDataTable(serviceSubtaskService.patItem(ivrTaskcall));
    }
    /**
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -186,7 +186,7 @@
        }
        log.info("tid和pid的值为:{},{}", tid, pid);
        return success(serviceTaskService.getScriptInfoByCondition(tid, pid));
        return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true));
    }
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.reflect.TypeToken;
@@ -17,6 +18,7 @@
import com.smartor.common.SendService;
import com.smartor.domain.*;
import com.smartor.mapper.ServiceTaskMapper;
import com.smartor.mapper.SysUserImportMapper;
import com.smartor.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@@ -63,6 +65,9 @@
    @Autowired
    private PlatformTransactionManager transactionManager;
    @Autowired
    private SysUserImportMapper sysUserImportMapper;
    @Value("${localIP}")
    private String localIP;
@@ -119,36 +124,30 @@
    }
    public void importData() {
//        String filePath = "path/to/your/file.txt"; // æ›¿æ¢ä¸ºä½ çš„æ–‡ä»¶è·¯å¾„
//
//        try {
//            // è¯»å–文件内容
//            String jsonContent = new String(Files.readAllBytes(Paths.get(filePath)));
//
//            // åˆ›å»ºObjectMapper对象
//            ObjectMapper objectMapper = new ObjectMapper();
//
//            // è§£æžJSON为JsonNode
//            JsonNode rootNode = objectMapper.readTree(jsonContent);
//            // èŽ·å–resultList
//            JsonNode resultListNode = rootNode.path("results").path("resultList");
//            // éåކresultList中的每个对象
//            for (JsonNode item : resultListNode) {
//                String userName = item.path("staffNum").asText();
//                String idCard = item.path("idCard").asText();
//                String personnelStampNum = item.path("defaultWardId").asText();
//                String personnelStampNum = item.path("defaultWardName").asText();
//                String deptName = item.path("defaultDeptName").asText();
//                String deptCode = item.path("defaultDeptId").asText();
//                String phonenumber = item.path("telphone").asText();
//                String nickName = item.path("staffName").asText();
//                String sex = item.path("staffSex").asText();
//
//            }
//
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        String filePath = "C:\\Users\\86176\\Desktop\\新建文本文档 4.txt"; // æ›¿æ¢ä¸ºä½ çš„æ–‡ä»¶è·¯å¾„
        try {
            // è¯»å–文件内容
            String jsonContent = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);
            // åˆ›å»ºObjectMapper对象
            ObjectMapper objectMapper = new ObjectMapper();
            // è§£æžJSON为JsonNode
            JsonNode rootNode = objectMapper.readTree(jsonContent);
            // èŽ·å–resultList
            JsonNode resultListNode = rootNode.path("results").path("resultList");
            // éåކresultList中的每个对象
            for (JsonNode item : resultListNode) {
                SysUserImport person = objectMapper.treeToValue(item, SysUserImport.class);
                person.setStaffPhoto("");
                sysUserImportMapper.insertSysUserImport(person);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
@@ -563,7 +562,7 @@
                patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
                //如果是出院,先通过患者编号和流水号去查一下,患者是否存在,如果存在,则进行修改
                PatMedInhosp inhosp = new PatMedInhosp();
                inhosp.setInhospno(patArchive.getPatientno());
                inhosp.setPatno(patArchive.getPatientno());
                inhosp.setSerialnum(patMedInhosp.getSerialnum());
                List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhospList(inhosp);
                if (CollectionUtils.isNotEmpty(patMedInhosps)) {
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java
@@ -45,4 +45,9 @@
    @ApiModelProperty(value = "题目ID")
    private Long scriptid;
    /**
     * æ˜¯å¦å®Œæˆ
     */
    private Boolean isFinish = true;
}
smartor/src/main/java/com/smartor/domain/SysUserImport.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,330 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * ç”¨æˆ·ä¿¡æ¯å¯¹è±¡ sys_user_import
 *
 * @author lihu
 * @date 2024-09-23
 */
@Data
@ApiModel("用户信息Import")
public class SysUserImport extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ç”¨æˆ·ID
     */
    @ApiModelProperty("用户ID")
    //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /**
     * éƒ¨é—¨ID
     */
    @ApiModelProperty("部门ID")
    @Excel(name = "部门ID")
    private String subId;
    private String wards;
    private String defaultHisWardId;
    private String defaultWardName;
    private String openId;
    private String defaultWardId;
    private String caUpdateTime;
    private String caPic;
    private String sort;
    /**
     * éƒ¨é—¨ç¼–号
     */
    @ApiModelProperty("部门编号")
    @Excel(name = "部门编号")
    private String hisStaffId;
    /**
     * éƒ¨é—¨åç§°
     */
    @ApiModelProperty("部门名称")
    @Excel(name = "部门名称")
    private String personnelStampNum;
    /**
     * ç”¨æˆ·è´¦å·
     */
    @ApiModelProperty("用户账号")
    @Excel(name = "用户账号")
    private String idCard;
    /**
     * ç”¨æˆ·æ˜µç§°
     */
    @ApiModelProperty("用户昵称")
    @Excel(name = "用户昵称")
    private String staffPhoto;
    /**
     * ç”¨æˆ·ç±»åž‹ï¼ˆ00系统用户)
     */
    @ApiModelProperty("用户类型(00系统用户)")
    @Excel(name = "用户类型", readConverterExp = "0=0系统用户")
    private String effectiveStart;
    /**
     * æ‚£è€…范围:0全部,1医生、2护士、9无
     */
    @ApiModelProperty("患者范围:0全部,1医生、2护士、9无")
    @Excel(name = "患者范围:0全部,1医生、2护士、9无")
    private String personnelProfile;
    /**
     * èŒç§°
     */
    @ApiModelProperty("职称")
    @Excel(name = "职称")
    private String staffNation;
    /**
     * å²—位
     */
    @ApiModelProperty("岗位")
    @Excel(name = "岗位")
    private String staffNum;
    /**
     * ç”¨æˆ·é‚®ç®±
     */
    @ApiModelProperty("用户邮箱")
    @Excel(name = "用户邮箱")
    private String effectiveEnd;
    /**
     * æ‰‹æœºå·ç 
     */
    @ApiModelProperty("手机号码")
    @Excel(name = "手机号码")
    private String insuranceCode;
    /**
     * ç”¨æˆ·æ€§åˆ«ï¼ˆ0男 1女 2未知)
     */
    @ApiModelProperty("用户性别(0男 1女 2未知)")
    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
    private String searchCode3;
    /**
     * å¤´åƒåœ°å€
     */
    @ApiModelProperty("头像地址")
    @Excel(name = "头像地址")
    private String searchCode2;
    /**
     * å¯†ç 
     */
    @ApiModelProperty("密码")
    @Excel(name = "密码")
    private String searchCode1;
    /**
     * å¸å·çŠ¶æ€ï¼ˆ0正常 1停用)
     */
    @ApiModelProperty("帐号状态(0正常 1停用)")
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private String hospitalId;
    /**
     * åˆ é™¤æ ‡å¿—(0:未删除 1:已删除)
     */
    @ApiModelProperty("删除标志(0:未删除 1:已删除)")
    @Excel(name = "删除标志", readConverterExp = "0=:未删除,1=:已删除")
    private String preUpdater;
    /**
     * æœ€åŽç™»å½•IP
     */
    @ApiModelProperty("最后登录IP")
    @Excel(name = "最后登录IP")
    private String staffName;
    /**
     * æœ€åŽç™»å½•æ—¶é—´
     */
    @ApiModelProperty("最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String defaultDeptName;
    /**
     * åˆ›å»ºè€…
     */
    @ApiModelProperty("创建者")
    @Excel(name = "创建者")
    private String state;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String famousDoctorRank;
    /**
     * æ›´æ–°è€…
     */
    @ApiModelProperty("更新者")
    @Excel(name = "更新者")
    private String firstWorkDate;
    /**
     * æ›´æ–°æ—¶é—´
     */
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private String preUpdaterNum;
    /**
     * å¤‡æ³¨
     */
    @ApiModelProperty("备注")
    @Excel(name = "备注")
    private String staffStatus;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String mgrPosiCode;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String defaultHisDeptId;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String staffSex;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String staffType;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String userId;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String preUpdateTime;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String famousDoctorRankName;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String personnelBirthday;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String staffTitle;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String signPic;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String telphone;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String employPostCode;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String defaultDeptId;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String depts;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String staffId;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String staffLevel;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String selfCollectDialecticalFees;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String subIds;
}
smartor/src/main/java/com/smartor/mapper/SysUserImportMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.smartor.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.smartor.domain.SysUserImport;
/**
 * ç”¨æˆ·ä¿¡æ¯Mapper接口
 *
 * @author lihu
 * @date 2024-09-23
 */
@Mapper
public interface SysUserImportMapper
{
    /**
     * æŸ¥è¯¢ç”¨æˆ·ä¿¡æ¯
     *
     * @param id ç”¨æˆ·ä¿¡æ¯ä¸»é”®
     * @return ç”¨æˆ·ä¿¡æ¯
     */
    public SysUserImport selectSysUserImportById(Long id);
    /**
     * æŸ¥è¯¢ç”¨æˆ·ä¿¡æ¯åˆ—表
     *
     * @param sysUserImport ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆ
     */
    public List<SysUserImport> selectSysUserImportList(SysUserImport sysUserImport);
    /**
     * æ–°å¢žç”¨æˆ·ä¿¡æ¯
     *
     * @param sysUserImport ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int insertSysUserImport(SysUserImport sysUserImport);
    /**
     * ä¿®æ”¹ç”¨æˆ·ä¿¡æ¯
     *
     * @param sysUserImport ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int updateSysUserImport(SysUserImport sysUserImport);
    /**
     * åˆ é™¤ç”¨æˆ·ä¿¡æ¯
     *
     * @param id ç”¨æˆ·ä¿¡æ¯ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteSysUserImportById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·ä¿¡æ¯
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteSysUserImportByIds(Long[] ids);
}
smartor/src/main/java/com/smartor/service/IServiceTaskService.java
@@ -68,7 +68,7 @@
     * @param patid
     * @return
     */
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid);
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid,Boolean isFinish);
}
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -183,6 +183,7 @@
    public int deletePatMedInhospByInhospid(Long inhospid) {
        return patMedInhospMapper.deletePatMedInhospByInhospid(inhospid);
    }
    /**
     * åˆ é™¤æ‚£è€…住院记录信息
     *
@@ -325,26 +326,53 @@
            serviceSubtask.setServiceType("2");
            serviceSubtask.setServiceform(serviceTask.getPreachform());
            serviceSubtask.setHospType("2");
            serviceSubtask.setCreateTime(new Date());
            serviceSubtask.setUpdateTime(new Date());
            serviceSubtask.setCreateBy(patMedInhosp1.getNurseName());
            serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode());
            serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname());
            //设置发送时间
            Date newDate = addDays(patMedInhosp1.getEndtime(), stt.getSendDay());
            serviceSubtask.setLongSendTime(newDate);
            //患者发送时间
            if (StringUtils.isNotEmpty(remark)) {
                serviceSubtask.setSendstate(4L);
            if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
                remark = patArchive.getNotrequiredreason();
                serviceSubtask.setRemark(remark);
                serviceSubtask.setResult("error");
                serviceSubtask.setFinishtime(new Date());
                //不执行
                serviceSubtask.setSendstate(4L);
            } else if (patArchive.getNotrequiredFlag().equals("4")) {
                //人不在了,或者其它原因,也不能随访
                serviceSubtask.setSendstate(4L);
                serviceSubtask.setRemark(patArchive.getNotrequiredreason());
                serviceSubtask.setResult("error");
                serviceSubtask.setFinishtime(new Date());
            }
            //在新增之前,先通过患者ID,sendstate=2查询一下,在所有长期任务中,是不是还有该患者待执行的任务,有的话,比较之前的endtime是否小于当前的endtaime,如果之前的小于现在的,则直接将之前的停掉(原因再入院)
            ServiceSubtaskVO subtask = new ServiceSubtaskVO();
            subtask.setPatid(patArchive.getId());
            subtask.setSendstate(2L);
            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
            log.error("该患者待执行的任务:{}", selectServiceSubtaskList);
            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
                    if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
                        //不是长期任务,不处理
                        continue;
                    }
                    if (serviceSubtask1.getEndtime().before(serviceSubtask.getEndtime())) {
                        //如果当前循环的子任务的出院时间在“准备新增的子任务”的出院时间之前,则将循环的子任务停掉
                        serviceSubtask1.setSendstate(4L);
                        serviceSubtask1.setRemark("患者再入院");
                        serviceSubtask1.setResult("error");
                        serviceSubtask1.setFinishtime(new Date());
                        serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
                    } else {
                        //相反,则将当有的数据停掉
                        serviceSubtask.setResult("error");
                        serviceSubtask.setFinishtime(new Date());
                        serviceSubtask.setSendstate(4L);
                        serviceSubtask.setRemark("患者再入院");
                    }
                }
            }
            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
            //将check_flag改成1(已处理)
            PatMedInhosp patMedInhosp2 = new PatMedInhosp();
@@ -352,6 +380,41 @@
            patMedInhosp2.setCheckFlag("1");
            patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
        }
        //获取未处理在院的数据(如果刚刚出院的患者数据的出院时间,在下面查询出的入院时间之前,那之前的出院患者的数据,也得停掉,因为又入院了)
        patMedInhosp.setCheckFlag("0");
        patMedInhosp.setInhospstate("0");
        List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
        if (CollectionUtils.isNotEmpty(patMedInhospList) && patMedInhospList.size() > 0) {
            for (PatMedInhosp patMedInhosp1 : patMedInhospList) {
                //获取当前入院患者的待执行的出院子任务随访信息
                ServiceSubtaskVO subtask = new ServiceSubtaskVO();
                subtask.setPatid(patMedInhosp1.getPatid());
                subtask.setSendstate(2L);
                List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
                log.error("入院的患者待执行的任务:{}", selectServiceSubtaskList);
                if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
                    for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
                        if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
                            //不是长期任务,不处理
                            continue;
                        }
                        if (serviceSubtask1.getEndtime().before(patMedInhosp1.getStarttime())) {
                            //如果当前循环的子任务的出院时间在“准备新增的子任务”的出院时间之前,则将循环的子任务停掉
                            serviceSubtask1.setSendstate(4L);
                            serviceSubtask1.setRemark("患者再入院");
                            serviceSubtask1.setResult("error");
                            serviceSubtask1.setFinishtime(new Date());
                            serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
                        }
                    }
                }
                //将患入的入院数据设置为已处理
                patMedInhosp1.setCheckFlag("1");
                patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
            }
        }
        return 1;
    }
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -247,7 +247,7 @@
        log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq);
        Map<String, Object> map = new HashMap<>();
        Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid());
        Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish());
        if (scriptInfoByCondition.get("type").equals("1")) {
            List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script");
            for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) {
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -147,7 +147,7 @@
    }
    @Override
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid) {
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid, Boolean isFinish) {
        Map<String, Object> map = new HashMap<>();
        ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
        serviceSubtaskVO.setPatid(patid);
@@ -169,10 +169,10 @@
            info = sfInfo(serviceTask, patid);
        } else if (serviceTask.getType().equals("2")) {
            //问卷
            info = wjInfo(serviceTask, patid);
            info = wjInfo(serviceTask, patid, isFinish);
        } else {
            //宣教
            info = xjInfo(Long.valueOf(serviceTask.getLibtemplateid()), taskid, patid);
            info = xjInfo(Long.valueOf(serviceTask.getLibtemplateid()), taskid, patid,isFinish);
        }
        //只要打开了页面,就算成功
@@ -262,14 +262,15 @@
     * @param patid
     * @return
     */
    private List wjInfo(ServiceTask serviceTask, Long patid) {
    private List wjInfo(ServiceTask serviceTask, Long patid, Boolean isFinish) {
        //用户点击了外链,就算他领取了
        ServiceSubtask serviceSubtask = new ServiceSubtask();
        serviceSubtask.setSendstate(1L);
        serviceSubtask.setPatid(patid);
        serviceSubtask.setTaskid(serviceTask.getTaskid());
        serviceSubtaskMapper.updateServiceSubtaskByPatId(serviceSubtask);
        if (isFinish == true) {
            ServiceSubtask serviceSubtask = new ServiceSubtask();
            serviceSubtask.setSendstate(1L);
            serviceSubtask.setPatid(patid);
            serviceSubtask.setTaskid(serviceTask.getTaskid());
            serviceSubtaskMapper.updateServiceSubtaskByPatId(serviceSubtask);
        }
        //通过模板ID获取问题信息
        SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
        svyLibTemplateScript.setSvyid(Long.valueOf(serviceTask.getLibtemplateid()));
@@ -325,13 +326,15 @@
        return svyLibTemplateScriptVOS;
    }
    private List xjInfo(Long templateId, Long taskid, Long patid) {
        ServiceSubtask serviceSubtask = new ServiceSubtask();
        serviceSubtask.setTaskid(taskid);
        serviceSubtask.setPatid(patid);
        serviceSubtask.setResult("完成");
        serviceSubtask.setFinishtime(new Date());
        serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
    private List xjInfo(Long templateId, Long taskid, Long patid, Boolean isFinish) {
        if (isFinish == true) {
            ServiceSubtask serviceSubtask = new ServiceSubtask();
            serviceSubtask.setTaskid(taskid);
            serviceSubtask.setPatid(patid);
            serviceSubtask.setResult("完成");
            serviceSubtask.setFinishtime(new Date());
            serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
        }
        HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(Long.valueOf(templateId));
        List list = new ArrayList();
        list.add(heLibrary);
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -500,26 +500,14 @@
            <if test="deptname != null and deptname != ''">
                AND d.deptname LIKE concat('%',#{deptname}, '%')
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (d.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR d.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
            <if test="leavehospitaldistrictcodes != null">
                AND d.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
            <if test="leaveldeptcodes != null">
                AND d.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -198,31 +198,20 @@
            <if test="leaveldeptname != null  and leaveldeptname != ''">and b.leaveldeptname like concat('%',
                #{leaveldeptname}, '%')
            </if>
               <if test="patid != null  and patid != ''">and a.id =#{patid}
            <if test="patid != null  and patid != ''">and a.id =#{patid}
            </if>
            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">and
                b.leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%')
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
            <if test="leavehospitaldistrictcodes != null">
                AND b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
            <if test="leaveldeptcodes != null">
                AND b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
@@ -311,26 +300,14 @@
                #{leavediagname}, '%')
            </if>
            <if test="drname != null  and drname != ''">and b.drname like concat('%', #{drname}, '%')</if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
            <if test="leavehospitaldistrictcodes != null ">
                AND b.leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
            <if test="leaveldeptcodes != null">
                AND b.leaveldeptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -178,26 +178,14 @@
            <if test="templatename != null  and templatename != ''">and templatename like concat('%', #{templatename},
                '%')
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
            <if test="leavehospitaldistrictcodes != null">
                AND leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
            <if test=" leaveldeptcodes != null">
                AND deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -146,26 +146,15 @@
            <if test="sendState != null  ">and send_state = #{sendState}</if>
            <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname = #{leavehospitaldistrictname}</if>
            <if test="leavehospitaldistrictcode != null  ">and leavehospitaldistrictcode = #{leavehospitaldistrictcode}</if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
                AND (leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
                OR deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close="))">
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
            <if test="leavehospitaldistrictcodes != null ">
                AND leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
            <if test="leaveldeptcodes != null">
                AND deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,621 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.SysUserImportMapper">
    <resultMap type="com.smartor.domain.SysUserImport" id="SysUserImportResult">
        <result property="id" column="id"/>
        <result property="subId" column="sub_id"/>
        <result property="caUpdateTime" column="caUpdateTime"/>
        <result property="wards" column="wards"/>
        <result property="hisStaffId" column="his_staff_id"/>
        <result property="personnelStampNum" column="personnel_stamp_num"/>
        <result property="idCard" column="id_card"/>
        <result property="staffPhoto" column="staff_photo"/>
        <result property="effectiveStart" column="effective_start"/>
        <result property="personnelProfile" column="personnel_profile"/>
        <result property="staffNation" column="staff_nation"/>
        <result property="staffNum" column="staff_num"/>
        <result property="effectiveEnd" column="effective_end"/>
        <result property="insuranceCode" column="insurance_code"/>
        <result property="searchCode3" column="search_code3"/>
        <result property="searchCode2" column="search_code2"/>
        <result property="searchCode1" column="search_code1"/>
        <result property="hospitalId" column="hospital_id"/>
        <result property="preUpdater" column="pre_updater"/>
        <result property="staffName" column="staff_name"/>
        <result property="defaultDeptName" column="default_dept_name"/>
        <result property="state" column="state"/>
        <result property="famousDoctorRank" column="famous_doctor_rank"/>
        <result property="firstWorkDate" column="first_work_date"/>
        <result property="preUpdaterNum" column="pre_updater_num"/>
        <result property="staffStatus" column="staff_status"/>
        <result property="mgrPosiCode" column="mgr_posi_code"/>
        <result property="defaultHisDeptId" column="default_his_dept_id"/>
        <result property="defaultWardId" column="default_ward_id"/>
        <result property="updateTime" column="update_time"/>
        <result property="staffSex" column="staff_sex"/>
        <result property="staffType" column="staff_type"/>
        <result property="userId" column="user_id"/>
        <result property="preUpdateTime" column="pre_update_time"/>
        <result property="famousDoctorRankName" column="famous_doctor_rank_name"/>
        <result property="personnelBirthday" column="personnel_birthday"/>
        <result property="staffTitle" column="staff_title"/>
        <result property="signPic" column="sign_pic"/>
        <result property="createTime" column="create_time"/>
        <result property="telphone" column="telphone"/>
        <result property="employPostCode" column="employ_post_code"/>
        <result property="defaultDeptId" column="default_dept_id"/>
        <result property="depts" column="depts"/>
        <result property="staffId" column="staff_id"/>
        <result property="staffLevel" column="staff_level"/>
        <result property="selfCollectDialecticalFees" column="self_collect_dialectical_fees"/>
        <result property="subIds" column="sub_ids"/>
        <result property="defaultHisWardId" column="default_his_ward_id"/>
        <result property="defaultWardName" column="default_ward_name"/>
        <result property="openId" column="open_id"/>
    </resultMap>
    <sql id="selectSysUserImportVo">
        select id,
               sub_id,
               default_his_ward_id,
               default_ward_name,
               his_staff_id,
               default_ward_id,
               personnel_stamp_num,
               id_card,
               staff_photo,
               effective_start,
               personnel_profile,
               staff_nation,
               staff_num,
               effective_end,
               insurance_code,
               search_code3,
               search_code2,
               search_code1,
               hospital_id,
               pre_updater,
               staff_name,
               default_dept_name,
               state,
               famous_doctor_rank,
               first_work_date,
               pre_updater_num,
               staff_status,
               mgr_posi_code,
               default_his_deptId,
               update_time,
               staff_sex,
               staff_type,
               user_id,
               pre_update_time,
               famous_doctor_rank_name,
               personnel_birthday,
               staff_title,
               sign_pic,
               open_id,
               create_time,
               telphone,
               employ_post_code,
               default_dept_id,
               depts,
               staff_id,
               staff_level,
               self_collect_dialectical_fees,
               sub_ids
        from sys_user_import
    </sql>
    <select id="selectSysUserImportList" parameterType="com.smartor.domain.SysUserImport"
            resultMap="SysUserImportResult">
        <include refid="selectSysUserImportVo"/>
        <where>
            <if test="subId != null ">
                and sub_id = #{subId}
            </if>
            <if test="hisStaffId != null  and hisStaffId != ''">
                and his_staff_id = #{hisStaffId}
            </if>
            <if test="personnelStampNum != null  and personnelStampNum != ''">
                and personnel_stamp_num = #{personnelStampNum}
            </if>
            <if test="idCard != null  and idCard != ''">
                and id_card = #{idCard}
            </if>
            <if test="defaultWardId != null  and defaultWardId != ''">
                and default_ward_id = #{defaultWardId}
            </if>
            <if test="staffPhoto != null  and staffPhoto != ''">
                and staff_photo = #{staffPhoto}
            </if>
            <if test="effectiveStart != null  and effectiveStart != ''">
                and effective_start = #{effectiveStart}
            </if>
            <if test="personnelProfile != null  and personnelProfile != ''">
                and personnel_profile = #{personnelProfile}
            </if>
            <if test="staffNation != null  and staffNation != ''">
                and staff_nation = #{staffNation}
            </if>
            <if test="staffNum != null  and staffNum != ''">
                and staff_num = #{staffNum}
            </if>
            <if test="effectiveEnd != null  and effectiveEnd != ''">
                and effective_end = #{effectiveEnd}
            </if>
            <if test="insuranceCode != null  and insuranceCode != ''">
                and insurance_code = #{insuranceCode}
            </if>
            <if test="searchCode3 != null  and searchCode3 != ''">
                and search_code3 = #{searchCode3}
            </if>
            <if test="searchCode2 != null  and searchCode2 != ''">
                and search_code2 = #{searchCode2}
            </if>
            <if test="searchCode1 != null  and searchCode1 != ''">
                and search_code1 = #{searchCode1}
            </if>
            <if test="hospitalId != null  and hospitalId != ''">
                and hospital_id = #{hospitalId}
            </if>
            <if test="preUpdater != null  and preUpdater != ''">
                and pre_updater = #{preUpdater}
            </if>
            <if test="staffName != null  and staffName != ''">
                and staff_name like concat('%', #{staffName}, '%')
            </if>
            <if test="defaultDeptName != null ">
                and default_dept_name like concat('%', #{defaultDeptName}, '%')
            </if>
            <if test="state != null  and state != ''">
                and state = #{state}
            </if>
            <if test="famousDoctorRank != null ">
                and famous_doctor_rank = #{famousDoctorRank}
            </if>
            <if test="firstWorkDate != null  and firstWorkDate != ''">
                and first_work_date = #{firstWorkDate}
            </if>
            <if test="preUpdaterNum != null ">
                and pre_updater_num = #{preUpdaterNum}
            </if>
            <if test="staffStatus != null  and staffStatus != ''">
                and staff_status = #{staffStatus}
            </if>
            <if test="mgrPosiCode != null  and mgrPosiCode != ''">
                and mgr_posi_code = #{mgrPosiCode}
            </if>
            <if test="defaultHisDeptId != null  and defaultHisDeptId != ''">
                and default_his_dept_id = #{defaultHisDeptId}
            </if>
            <if test="staffSex != null  and staffSex != ''">
                and staff_sex = #{staffSex}
            </if>
            <if test="staffType != null  and staffType != ''">
                and staff_type = #{staffType}
            </if>
            <if test="userId != null ">
                and user_id = #{userId}
            </if>
            <if test="preUpdateTime != null ">
                and pre_update_time = #{preUpdateTime}
            </if>
            <if test="famousDoctorRankName != null  and famousDoctorRankName != ''">
                and famous_doctor_rank_name like concat('%', #{famousDoctorRankName}, '%')
            </if>
            <if test="personnelBirthday != null  and personnelBirthday != ''">
                and personnel_birthday = #{personnelBirthday}
            </if>
            <if test="staffTitle != null  and staffTitle != ''">
                and staff_title = #{staffTitle}
            </if>
            <if test="signPic != null  and signPic != ''">
                and sign_pic = #{signPic}
            </if>
            <if test="telphone != null  and telphone != ''">
                and telphone = #{telphone}
            </if>
            <if test="employPostCode != null  and employPostCode != ''">
                and employ_post_code = #{employPostCode}
            </if>
            <if test="defaultDeptId != null ">
                and default_dept_id = #{defaultDeptId}
            </if>
            <if test="depts != null  and depts != ''">
                and depts = #{depts}
            </if>
            <if test="staffId != null ">
                and staff_id = #{staffId}
            </if>
            <if test="staffLevel != null  and staffLevel != ''">
                and staff_level = #{staffLevel}
            </if>
            <if test="selfCollectDialecticalFees != null  and selfCollectDialecticalFees != ''">
                and self_collect_dialectical_fees = #{selfCollectDialecticalFees}
            </if>
            <if test="subIds != null  and subIds != ''">
                and sub_ids = #{subIds}
            </if>
            <if test="defaultHisWardId != null  and defaultHisWardId != ''">
                and default_his_ward_id = #{defaultHisWardId}
            </if>
            <if test="defaultWardName != null  and defaultWardName != ''">
                and default_ward_name = #{defaultWardName}
            </if>
        </where>
    </select>
    <select id="selectSysUserImportById" parameterType="Long"
            resultMap="SysUserImportResult">
        <include refid="selectSysUserImportVo"/>
        where id = #{id}
    </select>
    <insert id="insertSysUserImport" parameterType="com.smartor.domain.SysUserImport" useGeneratedKeys="true"
            keyProperty="id">
        insert into sys_user_import
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="subId != null">sub_id,
            </if>
            <if test="hisStaffId != null">his_staff_id,
            </if>
            <if test="personnelStampNum != null">personnel_stamp_num,
            </if>
            <if test="idCard != null and idCard != ''">id_card,
            </if>
            <if test="staffPhoto != null and staffPhoto != ''">staff_photo,
            </if>
            <if test="effectiveStart != null">effective_start,
            </if>
            <if test="personnelProfile != null and personnelProfile != ''">personnel_profile,
            </if>
            <if test="staffNation != null">staff_nation,
            </if>
            <if test="staffNum != null">staff_num,
            </if>
            <if test="effectiveEnd != null">effective_end,
            </if>
            <if test="insuranceCode != null">insurance_code,
            </if>
            <if test="searchCode3 != null">search_code3,
            </if>
            <if test="searchCode2 != null">search_code2,
            </if>
            <if test="searchCode1 != null">search_code1,
            </if>
            <if test="hospitalId != null">hospital_id,
            </if>
            <if test="preUpdater != null">pre_updater,
            </if>
            <if test="staffName != null">staff_name,
            </if>
            <if test="defaultDeptName != null">default_dept_name,
            </if>
            <if test="state != null">state,
            </if>
            <if test="famousDoctorRank != null">famous_doctor_rank,
            </if>
            <if test="firstWorkDate != null">first_work_date,
            </if>
            <if test="preUpdaterNum != null">pre_updater_num,
            </if>
            <if test="staffStatus != null">staff_status,
            </if>
            <if test="mgrPosiCode != null">mgr_posi_code,
            </if>
            <if test="defaultHisDeptId != null">default_his_dept_id,
            </if>
            <if test="updateTime != null">update_time,
            </if>
            <if test="staffSex != null">staff_sex,
            </if>
            <if test="staffType != null">staff_type,
            </if>
            <if test="userId != null">user_id,
            </if>
            <if test="preUpdateTime != null">pre_update_time,
            </if>
            <if test="famousDoctorRankName != null">famous_doctor_rank_name,
            </if>
            <if test="personnelBirthday != null">personnel_birthday,
            </if>
            <if test="staffTitle != null">staff_title,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="telphone != null">telphone,
            </if>
            <if test="employPostCode != null">employ_post_code,
            </if>
            <if test="defaultDeptId != null">default_dept_id,
            </if>
            <if test="depts != null">depts,
            </if>
            <if test="staffId != null">staff_id,
            </if>
            <if test="staffLevel != null">staff_level,
            </if>
            <if test="selfCollectDialecticalFees != null">self_collect_dialectical_fees,
            </if>
            <if test="subIds != null">sub_ids,
            </if>
            <if test="defaultWardId != null">default_ward_id,
            </if>
            <if test="defaultHisWardId != null  and defaultHisWardId != ''">
                default_his_ward_id,
            </if>
            <if test="defaultWardName != null  and defaultWardName != ''">
                default_ward_name,
            </if>
            <if test="openId != null  and openId != ''">
                open_id,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="subId != null">#{subId},
            </if>
            <if test="hisStaffId != null">#{hisStaffId},
            </if>
            <if test="personnelStampNum != null">#{personnelStampNum},
            </if>
            <if test="idCard != null and idCard != ''">#{idCard},
            </if>
            <if test="staffPhoto != null and staffPhoto != ''">#{staffPhoto},
            </if>
            <if test="effectiveStart != null">#{effectiveStart},
            </if>
            <if test="personnelProfile != null and personnelProfile != ''">#{personnelProfile},
            </if>
            <if test="staffNation != null">#{staffNation},
            </if>
            <if test="staffNum != null">#{staffNum},
            </if>
            <if test="effectiveEnd != null">#{effectiveEnd},
            </if>
            <if test="insuranceCode != null">#{insuranceCode},
            </if>
            <if test="searchCode3 != null">#{searchCode3},
            </if>
            <if test="searchCode2 != null">#{searchCode2},
            </if>
            <if test="searchCode1 != null">#{searchCode1},
            </if>
            <if test="hospitalId != null">#{hospitalId},
            </if>
            <if test="preUpdater != null">#{preUpdater},
            </if>
            <if test="staffName != null">#{staffName},
            </if>
            <if test="defaultDeptName != null">#{defaultDeptName},
            </if>
            <if test="state != null">#{state},
            </if>
            <if test="famousDoctorRank != null">#{famousDoctorRank},
            </if>
            <if test="firstWorkDate != null">#{firstWorkDate},
            </if>
            <if test="preUpdaterNum != null">#{preUpdaterNum},
            </if>
            <if test="staffStatus != null">#{staffStatus},
            </if>
            <if test="mgrPosiCode != null">#{mgrPosiCode},
            </if>
            <if test="defaultHisDeptId != null">#{defaultHisDeptId},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
            <if test="staffSex != null">#{staffSex},
            </if>
            <if test="staffType != null">#{staffType},
            </if>
            <if test="userId != null">#{userId},
            </if>
            <if test="preUpdateTime != null">#{preUpdateTime},
            </if>
            <if test="famousDoctorRankName != null">#{famousDoctorRankName},
            </if>
            <if test="personnelBirthday != null">#{personnelBirthday},
            </if>
            <if test="staffTitle != null">#{staffTitle},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="telphone != null">#{telphone},
            </if>
            <if test="employPostCode != null">#{employPostCode},
            </if>
            <if test="defaultDeptId != null">#{defaultDeptId},
            </if>
            <if test="depts != null">#{depts},
            </if>
            <if test="staffId != null">#{staffId},
            </if>
            <if test="staffLevel != null">#{staffLevel},
            </if>
            <if test="selfCollectDialecticalFees != null">#{selfCollectDialecticalFees},
            </if>
            <if test="subIds != null">#{subIds},
            </if>
            <if test="defaultWardId != null">#{defaultWardId},
            </if>
            <if test="defaultHisWardId != null  and defaultHisWardId != ''">
                #{defaultHisWardId},
            </if>
            <if test="defaultWardName != null  and defaultWardName != ''">
                #{defaultWardName},
            </if>
            <if test="openId != null  and openId != ''">
                #{openId},
            </if>
        </trim>
    </insert>
    <update id="updateSysUserImport" parameterType="com.smartor.domain.SysUserImport">
        update sys_user_import
        <trim prefix="SET" suffixOverrides=",">
            <if test="subId != null">sub_id =
                #{subId},
            </if>
            <if test="hisStaffId != null">his_staff_id =
                #{hisStaffId},
            </if>
            <if test="personnelStampNum != null">personnel_stamp_num =
                #{personnelStampNum},
            </if>
            <if test="idCard != null and idCard != ''">id_card =
                #{idCard},
            </if>
            <if test="staffPhoto != null and staffPhoto != ''">staff_photo =
                #{staffPhoto},
            </if>
            <if test="effectiveStart != null">effective_start =
                #{effectiveStart},
            </if>
            <if test="personnelProfile != null and personnelProfile != ''">personnel_profile =
                #{personnelProfile},
            </if>
            <if test="staffNation != null">staff_nation =
                #{staffNation},
            </if>
            <if test="staffNum != null">staff_num =
                #{staffNum},
            </if>
            <if test="effectiveEnd != null">effective_end =
                #{effectiveEnd},
            </if>
            <if test="insuranceCode != null">insurance_code =
                #{insuranceCode},
            </if>
            <if test="searchCode3 != null">search_code3 =
                #{searchCode3},
            </if>
            <if test="searchCode2 != null">search_code2 =
                #{searchCode2},
            </if>
            <if test="searchCode1 != null">search_code1 =
                #{searchCode1},
            </if>
            <if test="hospitalId != null">hospital_id =
                #{hospitalId},
            </if>
            <if test="preUpdater != null">pre_updater =
                #{preUpdater},
            </if>
            <if test="staffName != null">staff_name =
                #{staffName},
            </if>
            <if test="defaultDeptName != null">default_dept_name =
                #{defaultDeptName},
            </if>
            <if test="state != null">state =
                #{state},
            </if>
            <if test="famousDoctorRank != null">famous_doctor_rank =
                #{famousDoctorRank},
            </if>
            <if test="firstWorkDate != null">first_work_date =
                #{firstWorkDate},
            </if>
            <if test="preUpdaterNum != null">pre_updater_num =
                #{preUpdaterNum},
            </if>
            <if test="staffStatus != null">staff_status =
                #{staffStatus},
            </if>
            <if test="mgrPosiCode != null">mgr_posi_code =
                #{mgrPosiCode},
            </if>
            <if test="defaultHisDeptId != null">default_his_dept_id =
                #{defaultHisDeptId},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="staffSex != null">staff_sex =
                #{staffSex},
            </if>
            <if test="staffType != null">staff_type =
                #{staffType},
            </if>
            <if test="userId != null">user_id =
                #{userId},
            </if>
            <if test="preUpdateTime != null">pre_update_time =
                #{preUpdateTime},
            </if>
            <if test="famousDoctorRankName != null">famous_doctor_rank_name =
                #{famousDoctorRankName},
            </if>
            <if test="personnelBirthday != null">personnel_birthday =
                #{personnelBirthday},
            </if>
            <if test="staffTitle != null">staff_title =
                #{staffTitle},
            </if>
            <if test="signPic != null">sign_pic =
                #{signPic},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="telphone != null">telphone =
                #{telphone},
            </if>
            <if test="employPostCode != null">employ_post_code =
                #{employPostCode},
            </if>
            <if test="defaultDeptId != null">default_dept_id =
                #{defaultDeptId},
            </if>
            <if test="depts != null">depts =
                #{depts},
            </if>
            <if test="staffId != null">staff_id =
                #{staffId},
            </if>
            <if test="staffLevel != null">staff_level =
                #{staffLevel},
            </if>
            <if test="selfCollectDialecticalFees != null">self_collect_dialectical_fees =
                #{selfCollectDialecticalFees},
            </if>
            <if test="subIds != null">sub_ids =
                #{subIds},
            </if>
            <if test="defaultWardId != null  and defaultWardId != ''">
                default_ward_id = #{defaultWardId},
            </if>
            <if test="defaultHisWardId != null  and defaultHisWardId != ''">
                default_his_ward_id = #{defaultHisWardId},
            </if>
            <if test="defaultWardName != null  and defaultWardName != ''">
                default_ward_name = #{defaultWardName,
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="deleteSysUserImportById" parameterType="Long">
        update sys_user_import
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
    <update id="deleteSysUserImportByIds" parameterType="String">
        update sys_user_import
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>