增加字典缓存,字典增加医疗机构
This commit is contained in:
parent
636de0d743
commit
949df56622
@ -1,4 +1,4 @@
|
||||
package com.transitPlatForm.system.domain;
|
||||
package com.transitPlatForm.common.core.domain.entity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
@ -56,4 +56,5 @@ public class RegApply {
|
||||
private String reqDetailName;
|
||||
private String bz;
|
||||
private String slzq;
|
||||
private String OrderDate;
|
||||
}
|
||||
|
||||
@ -42,4 +42,6 @@ public class RegDict extends BaseEntity {
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
private Integer hospital_id;
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.transitPlatForm.common.core.domain.entity.reg;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RegLocalconfig {
|
||||
private String smac;
|
||||
private String sip;
|
||||
private String sname;
|
||||
private String configvalue;
|
||||
private String create_by;
|
||||
private Date create_time;
|
||||
private String update_by;
|
||||
private Date update_time;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.transitPlatForm.common.core.domain.entity.reg;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RegOpt {
|
||||
private String opt_code;
|
||||
private String opt_name;
|
||||
private String opt_value;
|
||||
private String opt_class;
|
||||
private String bz;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.transitPlatForm.interfaceCommon.mapper;
|
||||
|
||||
public interface ComLocalconfigMapper {
|
||||
public interface RegLocalconfigMapper {
|
||||
String getLocalconfig(String smac);
|
||||
String getLocalconfigByIP(String ip);
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.transitPlatForm.interfaceCommon.mapper;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegOpt;
|
||||
|
||||
public interface RegOptMapper {
|
||||
RegOpt queryOptOne(String opt_code);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.transitPlatForm.system.mapper;
|
||||
package com.transitPlatForm.interfaceCommon.mapper;
|
||||
|
||||
import com.transitPlatForm.system.domain.SysConfig;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
package com.transitPlatForm.interfaceCommon.utils;
|
||||
|
||||
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.constant.CacheConstants;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysConfig;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysUser;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegSeq;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.ComLocalconfigMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.CommonMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegSeqMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.SysUserCommMapper;
|
||||
import com.transitPlatForm.common.core.redis.RedisCache;
|
||||
import com.transitPlatForm.common.core.text.Convert;
|
||||
import com.transitPlatForm.common.utils.StringUtils;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.*;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
@ -25,9 +25,15 @@ public class CommonUtil {
|
||||
@Autowired
|
||||
SysUserCommMapper sysUserCommMapper;
|
||||
@Autowired
|
||||
ComLocalconfigMapper comLocalconfigMapper;
|
||||
RegLocalconfigMapper regLocalconfigMapper;
|
||||
@Autowired
|
||||
RegSeqMapper regSeqMapper;
|
||||
@Autowired
|
||||
private SysConfigMapper configMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -57,11 +63,11 @@ public class CommonUtil {
|
||||
}
|
||||
|
||||
public String getLocalconfig(String smac) {
|
||||
return comLocalconfigMapper.getLocalconfig(smac);
|
||||
return regLocalconfigMapper.getLocalconfig(smac);
|
||||
}
|
||||
|
||||
public String getLocalconfigByIP(String ip) {
|
||||
return comLocalconfigMapper.getLocalconfigByIP(ip);
|
||||
return regLocalconfigMapper.getLocalconfigByIP(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,5 +115,19 @@ public class CommonUtil {
|
||||
return map;
|
||||
}
|
||||
|
||||
public String selectConfigByKey(String configKey) {
|
||||
String configValue = Convert.toStr(redisCache.getCacheObject(CacheConstants.SYS_CONFIG_KEY + configKey));
|
||||
if (StringUtils.isNotEmpty(configValue)) {
|
||||
return configValue;
|
||||
}
|
||||
SysConfig config = new SysConfig();
|
||||
config.setConfigKey(configKey);
|
||||
SysConfig retConfig = configMapper.selectConfig(config);
|
||||
if (StringUtils.isNotNull(retConfig)) {
|
||||
redisCache.setCacheObject(CacheConstants.SYS_CONFIG_KEY + configKey, retConfig.getConfigValue());
|
||||
return retConfig.getConfigValue();
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?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.transitPlatForm.interfaceCommon.mapper.ComLocalconfigMapper">
|
||||
<mapper namespace="com.transitPlatForm.interfaceCommon.mapper.RegLocalconfigMapper">
|
||||
<select id="getLocalconfig" resultType="String">
|
||||
select configvalue from com_localconfig where smac = #{smac}
|
||||
select configvalue from reg_localconfig where smac = #{smac}
|
||||
</select>
|
||||
<select id="getLocalconfigByIP" resultType="String">
|
||||
select configvalue from com_localconfig where sip = #{ip}
|
||||
select configvalue from reg_localconfig where sip = #{ip}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,8 @@
|
||||
<?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.transitPlatForm.interfaceCommon.mapper.RegOptMapper">
|
||||
<select id="queryOptOne" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegOpt">
|
||||
select * from reg_opt where opt_code = #{opt_code}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.transitPlatForm.system.mapper.SysConfigMapper">
|
||||
<mapper namespace="com.transitPlatForm.interfaceCommon.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
@ -2,7 +2,7 @@ package com.transitPlatForm.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.transitPlatForm.system.domain.SysConfig;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysConfig;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
|
||||
@ -13,8 +13,8 @@ import com.transitPlatForm.common.core.text.Convert;
|
||||
import com.transitPlatForm.common.enums.DataSourceType;
|
||||
import com.transitPlatForm.common.exception.ServiceException;
|
||||
import com.transitPlatForm.common.utils.StringUtils;
|
||||
import com.transitPlatForm.system.domain.SysConfig;
|
||||
import com.transitPlatForm.system.mapper.SysConfigMapper;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysConfig;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.SysConfigMapper;
|
||||
import com.transitPlatForm.system.service.ISysConfigService;
|
||||
|
||||
/**
|
||||
@ -30,14 +30,6 @@ public class SysConfigServiceImpl implements ISysConfigService {
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
// @PostConstruct
|
||||
// public void init() {
|
||||
// loadingConfigCache();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
@ -156,10 +148,10 @@ public class SysConfigServiceImpl implements ISysConfigService {
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigCache() {
|
||||
// List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
|
||||
// for (SysConfig config : configsList) {
|
||||
// redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
// }
|
||||
List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
|
||||
for (SysConfig config : configsList) {
|
||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -6,7 +6,7 @@ import com.transitPlatForm.common.core.domain.AjaxResult;
|
||||
import com.transitPlatForm.common.core.page.TableDataInfo;
|
||||
import com.transitPlatForm.common.enums.BusinessType;
|
||||
import com.transitPlatForm.common.utils.poi.ExcelUtil;
|
||||
import com.transitPlatForm.system.domain.SysConfig;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysConfig;
|
||||
import com.transitPlatForm.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package com.transitPlatForm.transitPF.controller;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegOpt;
|
||||
import com.transitPlatForm.transitPF.service.RegOptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 参数控制
|
||||
*/
|
||||
@Api(tags = "参数控制")
|
||||
@RestController
|
||||
@RequestMapping("/opt")
|
||||
@Slf4j
|
||||
public class RegOptController {
|
||||
|
||||
@Autowired
|
||||
RegOptService regOptService;
|
||||
|
||||
@ApiOperation("获取参数值")
|
||||
@GetMapping("/value")
|
||||
public Result getOptOne(String opt_code){
|
||||
return regOptService.getOptOne(opt_code);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("增加参数")
|
||||
@PostMapping("/add")
|
||||
public Result addOpt(RegOpt regOpt){
|
||||
return regOptService.addOpt(regOpt);
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,6 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "区域检验中心-常用字典管理")
|
||||
@ -27,6 +28,9 @@ import java.util.List;
|
||||
public class RegDictController extends BaseController {
|
||||
@Autowired
|
||||
private RegDictService regDictService;
|
||||
|
||||
public static final String[] dict_type = {"DEPT","DOCTOR"};
|
||||
|
||||
/**
|
||||
* 获取字典列表
|
||||
*/
|
||||
@ -68,6 +72,14 @@ public class RegDictController extends BaseController {
|
||||
@Log(title = SysLogConstants.DICT, businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody RegDict post) {
|
||||
String loginYLJG = getLoginUser().getSysLoginParam().getLoginYLJG();
|
||||
if(loginYLJG == null || loginYLJG.equals("")) return AjaxResult.error("没有获取到登录的医疗机构!");
|
||||
//匹配字典类型
|
||||
if(Arrays.stream(dict_type).anyMatch(post.getDictType():: equals)){
|
||||
post.setHospital_id(Integer.parseInt(loginYLJG));
|
||||
}else{
|
||||
post.setHospital_id(0); //默认医疗机构为0
|
||||
}
|
||||
if (!regDictService.checkDictNameUnique(post)) {
|
||||
return error("新增字典'" + post.getDictName() + "'失败,字典名称已存在");
|
||||
} else if (!regDictService.checkDictCodeUnique(post)) {
|
||||
|
||||
@ -69,7 +69,7 @@ public interface RegDictMapper {
|
||||
* @param dictType 类别
|
||||
* @return 结果
|
||||
*/
|
||||
RegDict checkDictNameUnique(@Param("dictName") String dictName,@Param("dictType") String dictType);
|
||||
RegDict checkDictNameUnique(@Param("dictName") String dictName,@Param("dictType") String dictType,@Param("hospital_id") int hospital_id);
|
||||
|
||||
/**
|
||||
* 校验字典编码
|
||||
@ -77,7 +77,7 @@ public interface RegDictMapper {
|
||||
* @param DictCode 字典编码
|
||||
* @return 结果
|
||||
*/
|
||||
RegDict checkDictCodeUnique(@Param("dictCode") String DictCode,@Param("dictType") String dictType);
|
||||
RegDict checkDictCodeUnique(@Param("dictCode") String DictCode,@Param("dictType") String dictType,@Param("hospital_id") int hospital_id);
|
||||
|
||||
List<RegDict> getInfoOne(String dict_type);
|
||||
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.transitPlatForm.transitPF.service;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegOpt;
|
||||
|
||||
public interface RegOptService {
|
||||
Result getOptOne(String optCode);
|
||||
|
||||
Result addOpt(RegOpt regOpt);
|
||||
}
|
||||
@ -2,9 +2,11 @@ package com.transitPlatForm.transitPF.service.impl;
|
||||
|
||||
import com.transitPlatForm.common.constant.UserConstants;
|
||||
import com.transitPlatForm.common.core.domain.AjaxResult;
|
||||
import com.transitPlatForm.common.core.domain.R;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.exception.ServiceException;
|
||||
import com.transitPlatForm.common.utils.StringUtils;
|
||||
import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LisUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.cache.RegDictCache;
|
||||
import com.transitPlatForm.transitPF.mapper.RegDictMapper;
|
||||
@ -23,6 +25,8 @@ import static com.transitPlatForm.common.core.domain.AjaxResult.success;
|
||||
public class RegDictServiceImpl implements RegDictService {
|
||||
@Autowired
|
||||
RegDictMapper dictMapper;
|
||||
@Autowired
|
||||
private CommonUtil commonUtil;
|
||||
|
||||
/**
|
||||
* 查询字典信息集合
|
||||
@ -66,7 +70,7 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
@Override
|
||||
public boolean checkDictNameUnique(RegDict Dict) {
|
||||
Long DictId = StringUtils.isNull(Dict.getDictId()) ? -1L : Dict.getDictId();
|
||||
RegDict info = dictMapper.checkDictNameUnique(Dict.getDictName(),Dict.getDictType());
|
||||
RegDict info = dictMapper.checkDictNameUnique(Dict.getDictName(),Dict.getDictType(),Dict.getHospital_id());
|
||||
if (StringUtils.isNotNull(info) && info.getDictId().longValue() != DictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -82,7 +86,7 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
@Override
|
||||
public boolean checkDictCodeUnique(RegDict Dict) {
|
||||
Long DictId = StringUtils.isNull(Dict.getDictId()) ? -1L : Dict.getDictId();
|
||||
RegDict info = dictMapper.checkDictCodeUnique(Dict.getDictCode(),Dict.getDictType());
|
||||
RegDict info = dictMapper.checkDictCodeUnique(Dict.getDictCode(),Dict.getDictType(),Dict.getHospital_id());
|
||||
if (StringUtils.isNotNull(info) && info.getDictId().longValue() != DictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -129,7 +133,14 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", Dict.getDictName()));
|
||||
}
|
||||
}
|
||||
return dictMapper.deleteDictByIds(DictIds);
|
||||
|
||||
int i = dictMapper.deleteDictByIds(DictIds);
|
||||
//重新设置缓存
|
||||
RegDict regDict = new RegDict();
|
||||
regDict.setDictId(DictIds[0]);
|
||||
List<RegDict> regDictList = dictMapper.selectDictList(regDict);
|
||||
RegDictCache.setDictCache(regDict.getDictType(),regDictList);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,6 +151,12 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
*/
|
||||
@Override
|
||||
public int insertDict(RegDict Dict) {
|
||||
//获取项目代号的最大值
|
||||
String dictIdentity = commonUtil.selectConfigByKey("dict_identity");
|
||||
if(dictIdentity == null) dictIdentity = LisUtil.isBank(dictIdentity);
|
||||
if(dictIdentity.equals("1")){
|
||||
Dict.setDictCode(getMaxNo(Dict.getDictType(),LisUtil.isBank(Dict.getHospital_id())));
|
||||
}
|
||||
int i = dictMapper.insertDict(Dict);
|
||||
//设置缓存
|
||||
List<RegDict> regDictList = dictMapper.getInfoOne(Dict.getDictType());
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package com.transitPlatForm.transitPF.service.impl;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegOpt;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegOptMapper;
|
||||
import com.transitPlatForm.transitPF.service.RegOptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class RegOptServiceImpl implements RegOptService {
|
||||
|
||||
@Autowired
|
||||
private RegOptMapper regOptMapper;
|
||||
|
||||
@Override
|
||||
public Result getOptOne(String optCode) {
|
||||
RegOpt regOpt = regOptMapper.queryOptOne(optCode);
|
||||
return new Result("0","获取参数成功!",regOpt.getOpt_value());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addOpt(RegOpt regOpt) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -287,7 +287,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
}
|
||||
});
|
||||
|
||||
String itemClassOne = "";
|
||||
String itemClassOne = "",yblxOne = "";
|
||||
int xh = 0, k = -1;
|
||||
String barcode = "";
|
||||
String jymd = "";
|
||||
@ -295,8 +295,9 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
for (Map<String, Object> stringObjectMap : reqSqdInfoList) {
|
||||
String itemClass = LisUtil.isBank(stringObjectMap.get("sample_SrcHospBarcode"));
|
||||
String yblx = LisUtil.isBank(stringObjectMap.get("sample_SampleTypeName"));
|
||||
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||
if (itemClassOne.equals(itemClass)) {
|
||||
if (itemClassOne.equals(itemClass) && yblxOne.equals(yblx)) {
|
||||
xh++;
|
||||
stringObjectMap.put("sample_Barcode", barcode);
|
||||
stringObjectMap.put("detail_OrderItemSerial", xh);
|
||||
@ -323,6 +324,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
}
|
||||
barcode = DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd") + srcHospCode + commonUtil.getNextSeq_pro("barcode", 4);
|
||||
itemClassOne = itemClass;
|
||||
yblxOne = yblx;
|
||||
}
|
||||
|
||||
stringObjectMap.put("sample_Barcode", barcode);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="hospital_id" column="hospital_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictVo">
|
||||
@ -56,16 +57,16 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="checkDictNameUnique" parameterType="String" resultMap="RegDictResult">
|
||||
<select id="checkDictNameUnique" resultMap="RegDictResult">
|
||||
select top 1 dict_id, dict_code, dict_name, dict_Sort, status, create_by, create_time, remark
|
||||
from Reg_Dict
|
||||
where dict_name=#{dictName} and dict_type = #{dictType}
|
||||
where dict_name=#{dictName} and dict_type = #{dictType} and hospital_id = #{hospital_id}
|
||||
</select>
|
||||
|
||||
<select id="checkDictCodeUnique" parameterType="String" resultMap="RegDictResult">
|
||||
<select id="checkDictCodeUnique" resultMap="RegDictResult">
|
||||
select top 1 dict_id, dict_code, dict_name, dict_Sort, status, create_by, create_time, remark
|
||||
from Reg_Dict
|
||||
where dict_code=#{dictCode} and dict_type = #{dictType}
|
||||
where dict_code=#{dictCode} and dict_type = #{dictType} and hospital_id = #{hospital_id}
|
||||
</select>
|
||||
|
||||
<update id="updateDict" parameterType="RegDict">
|
||||
@ -78,6 +79,7 @@
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="hospital_id != null">hospital_id = #{hospital_id},</if>
|
||||
update_time = getdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
@ -85,23 +87,23 @@
|
||||
|
||||
<insert id="insertDict" parameterType="RegDict" useGeneratedKeys="true" keyProperty="dictId">
|
||||
insert into Reg_Dict(
|
||||
<if test="dictId != null and dictId != 0">dict_id,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="dictCode != null and dictCode != ''">dict_code,</if>
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictSort != null">dict_Sort,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="hospital_id != null">hospital_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictId != null and dictId != 0">#{dictId},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="dictCode != null and dictCode != ''">#{dictCode},</if>
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictSort != null">#{dictSort},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="hospital_id != null">#{hospital_id},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
getdate()
|
||||
)
|
||||
|
||||
@ -4,10 +4,11 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.transitPlatForm.transitPF.mapper.RegRequestInfoMapper">
|
||||
<select id="queryRegRequestInfo" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApply">
|
||||
<![CDATA[select * from reg_apply where OrderTime >= #{begdate} and OrderTime <= #{enddate} ]]>
|
||||
<![CDATA[select *,CONVERT(VARCHAR(20), OrderTime, 23) as OrderDate from reg_apply where OrderTime >= #{begdate} and OrderTime <= #{enddate} ]]>
|
||||
<if test="patId != null and patId != ''"> and PatId = #{patId}</if>
|
||||
<if test="brxm != null and brxm != ''">and PatName like '%'+#{brxm}+'%'</if>
|
||||
<if test="status != null and status != ''">and Status = #{status}</if>
|
||||
order by OrderTime desc
|
||||
</select>
|
||||
|
||||
<select id="queryReqDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user