区域流转平台字典
This commit is contained in:
parent
fb6b3a4ea4
commit
8f5b118f95
@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:sqlserver://47.97.125.165:11433;DatabaseName=lisnet_test
|
||||
username: lis
|
||||
password: lisp@ssw0rd
|
||||
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=lisnet_ssrmyy
|
||||
username: sa
|
||||
password: qwe123!@#
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
package com.czlis.transitPF.controller.dict;
|
||||
|
||||
import com.czlis.common.annotation.Log;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.AjaxResult;
|
||||
import com.czlis.common.core.page.TableDataInfo;
|
||||
import com.czlis.common.enums.BusinessType;
|
||||
import com.czlis.common.utils.poi.ExcelUtil;
|
||||
import com.czlis.transitPF.pojo.SysHospital;
|
||||
import com.czlis.transitPF.service.IsysHospitalService;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "区域检验中心-医疗机构字典管理")
|
||||
@RestController
|
||||
@RequestMapping("/transitdict/hospital")
|
||||
@Slf4j
|
||||
public class HospitalController extends BaseController {
|
||||
@Autowired
|
||||
private IsysHospitalService sysHospitalService;
|
||||
/**
|
||||
* 获取医疗机构列表
|
||||
*/
|
||||
@ApiOperation("获取医疗机构列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysHospital post) {
|
||||
startPage();
|
||||
List<SysHospital> list = sysHospitalService.selectHospitalList(post);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ApiOperation("医疗机构导出")
|
||||
@Log(title = "医疗机构导出", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysHospital post) {
|
||||
List<SysHospital> list = sysHospitalService.selectHospitalList(post);
|
||||
ExcelUtil<SysHospital> util = new ExcelUtil<>(SysHospital.class);
|
||||
util.exportExcel(response, list, "医疗机构数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据医疗机构编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("获取详细信息")
|
||||
@GetMapping(value = "/{hospitalId}")
|
||||
public AjaxResult getInfo(@PathVariable Long hospitalId) {
|
||||
return success(sysHospitalService.selectHospitalById(hospitalId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增医疗机构
|
||||
*/
|
||||
@ApiOperation("新增医疗机构")
|
||||
@Log(title = "医疗机构管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysHospital post) {
|
||||
if (!sysHospitalService.checkHospitalNameUnique(post)) {
|
||||
return error("新增医疗机构'" + post.getHospitalName() + "'失败,医疗机构名称已存在");
|
||||
} else if (!sysHospitalService.checkHospitalCodeUnique(post)) {
|
||||
return error("新增医疗机构'" + post.getHospitalName() + "'失败,医疗机构编码已存在");
|
||||
}
|
||||
post.setCreateBy(getUsername());
|
||||
return toAjax(sysHospitalService.insertHospital(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改医疗机构
|
||||
*/
|
||||
@ApiOperation("修改医疗机构")
|
||||
@Log(title = "医疗机构管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysHospital post) {
|
||||
if (!sysHospitalService.checkHospitalNameUnique(post)) {
|
||||
return error("修改医疗机构'" + post.getHospitalName() + "'失败,医疗机构名称已存在");
|
||||
} else if (!sysHospitalService.checkHospitalCodeUnique(post)) {
|
||||
return error("修改医疗机构'" + post.getHospitalName() + "'失败,医疗机构编码已存在");
|
||||
}
|
||||
post.setUpdateBy(getUsername());
|
||||
return toAjax(sysHospitalService.updateHospital(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医疗机构
|
||||
*/
|
||||
@ApiOperation("删除医疗机构")
|
||||
@Log(title = "医疗机构管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{hospitalIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] postIds) {
|
||||
return toAjax(sysHospitalService.deleteHospitalByIds(postIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医疗机构选择框列表
|
||||
*/
|
||||
@ApiOperation("获取医疗机构选择框列表")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect() {
|
||||
List<SysHospital> posts = sysHospitalService.selectHospitalAll();
|
||||
return success(posts);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.czlis.transitPF.mapper;
|
||||
|
||||
import com.czlis.transitPF.pojo.SysHospital;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysHospitalMapper {
|
||||
/**
|
||||
* 查询医疗机构数据集合
|
||||
*
|
||||
* @param hospital 医疗机构信息
|
||||
* @return 医疗机构数据集合
|
||||
*/
|
||||
public List<SysHospital> selectHospitalList(SysHospital hospital);
|
||||
|
||||
/**
|
||||
* 查询所有医疗机构
|
||||
*
|
||||
* @return 医疗机构列表
|
||||
*/
|
||||
public List<SysHospital> selectHospitalAll();
|
||||
|
||||
/**
|
||||
* 通过医疗机构ID查询医疗机构信息
|
||||
*
|
||||
* @param hospitalId 医疗机构ID
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
public SysHospital selectHospitalById(Long hospitalId);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取医疗机构选择框列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 选中医疗机构ID列表
|
||||
*/
|
||||
// public List<Long> selectHospitalListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户所属医疗机构组
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 结果
|
||||
*/
|
||||
// public List<SysHospital> selectHospitalsByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 删除医疗机构信息
|
||||
*
|
||||
* @param hospitalId 医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHospitalById(Long hospitalId);
|
||||
|
||||
/**
|
||||
* 批量删除医疗机构信息
|
||||
*
|
||||
* @param hospitalIds 需要删除的医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHospitalByIds(Long[] hospitalIds);
|
||||
|
||||
/**
|
||||
* 修改医疗机构信息
|
||||
*
|
||||
* @param hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHospital(SysHospital hospital);
|
||||
|
||||
/**
|
||||
* 新增医疗机构信息
|
||||
*
|
||||
* @param hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHospital(SysHospital hospital);
|
||||
|
||||
/**
|
||||
* 校验医疗机构名称
|
||||
*
|
||||
* @param hospitalName 医疗机构名称
|
||||
* @return 结果
|
||||
*/
|
||||
public SysHospital checkHospitalNameUnique(String hospitalName);
|
||||
|
||||
/**
|
||||
* 校验医疗机构编码
|
||||
*
|
||||
* @param hospitalCode 医疗机构编码
|
||||
* @return 结果
|
||||
*/
|
||||
public SysHospital checkHospitalCodeUnique(String hospitalCode);
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.czlis.transitPF.pojo;
|
||||
|
||||
import com.czlis.common.annotation.Excel;
|
||||
import com.czlis.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysHospital extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 医疗机构序号
|
||||
*/
|
||||
@Excel(name = "医疗机构序号", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long hospitalId;
|
||||
/**
|
||||
* 医疗机构编码
|
||||
*/
|
||||
@Excel(name = "医疗机构编码")
|
||||
private String hospitalCode;
|
||||
|
||||
/**
|
||||
* 医疗机构名称
|
||||
*/
|
||||
@Excel(name = "医疗机构名称")
|
||||
private String hospitalName;
|
||||
/**
|
||||
* 医疗机构排序
|
||||
*/
|
||||
@Excel(name = "医疗机构令牌")
|
||||
private Integer hospitalUserinfo;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.czlis.transitPF.service;
|
||||
|
||||
import com.czlis.transitPF.pojo.SysHospital;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IsysHospitalService {
|
||||
/**
|
||||
* 查询医疗机构信息集合
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 医疗机构列表
|
||||
*/
|
||||
public List<SysHospital> selectHospitalList(SysHospital Hospital);
|
||||
|
||||
/**
|
||||
* 查询所有医疗机构
|
||||
*
|
||||
* @return 医疗机构列表
|
||||
*/
|
||||
public List<SysHospital> selectHospitalAll();
|
||||
|
||||
/**
|
||||
* 通过医疗机构ID查询医疗机构信息
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
public SysHospital selectHospitalById(Long HospitalId);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取医疗机构选择框列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 选中医疗机构ID列表
|
||||
*/
|
||||
public List<Long> selectHospitalListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 校验医疗机构名称
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkHospitalNameUnique(SysHospital Hospital);
|
||||
|
||||
/**
|
||||
* 校验医疗机构编码
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkHospitalCodeUnique(SysHospital Hospital);
|
||||
|
||||
/**
|
||||
* 通过医疗机构ID查询医疗机构使用数量
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int countUserHospitalById(Long HospitalId);
|
||||
|
||||
/**
|
||||
* 删除医疗机构信息
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHospitalById(Long HospitalId);
|
||||
|
||||
/**
|
||||
* 批量删除医疗机构信息
|
||||
*
|
||||
* @param HospitalIds 需要删除的医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHospitalByIds(Long[] HospitalIds);
|
||||
|
||||
/**
|
||||
* 新增保存医疗机构信息
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHospital(SysHospital Hospital);
|
||||
|
||||
/**
|
||||
* 修改保存医疗机构信息
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHospital(SysHospital Hospital);
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package com.czlis.transitPF.service.impl;
|
||||
|
||||
import com.czlis.common.constant.UserConstants;
|
||||
import com.czlis.common.exception.ServiceException;
|
||||
import com.czlis.common.utils.StringUtils;
|
||||
import com.czlis.transitPF.mapper.SysHospitalMapper;
|
||||
import com.czlis.transitPF.pojo.SysHospital;
|
||||
import com.czlis.transitPF.service.IsysHospitalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IsysHospitalServiceImpl implements IsysHospitalService {
|
||||
@Autowired
|
||||
SysHospitalMapper hospitalMapper;
|
||||
|
||||
/**
|
||||
* 查询医疗机构信息集合
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 医疗机构信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysHospital> selectHospitalList(SysHospital Hospital) {
|
||||
return hospitalMapper.selectHospitalList(Hospital);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有医疗机构
|
||||
*
|
||||
* @return 医疗机构列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysHospital> selectHospitalAll() {
|
||||
return hospitalMapper.selectHospitalAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过医疗机构ID查询医疗机构信息
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysHospital selectHospitalById(Long HospitalId) {
|
||||
return hospitalMapper.selectHospitalById(HospitalId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID获取医疗机构选择框列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 选中医疗机构ID列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectHospitalListByUserId(Long userId) {
|
||||
return null;//hospitalMapper.selectHospitalListByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验医疗机构名称是否唯一
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkHospitalNameUnique(SysHospital Hospital) {
|
||||
Long HospitalId = StringUtils.isNull(Hospital.getHospitalId()) ? -1L : Hospital.getHospitalId();
|
||||
SysHospital info = hospitalMapper.checkHospitalNameUnique(Hospital.getHospitalName());
|
||||
if (StringUtils.isNotNull(info) && info.getHospitalId().longValue() != HospitalId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验医疗机构编码是否唯一
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkHospitalCodeUnique(SysHospital Hospital) {
|
||||
Long HospitalId = StringUtils.isNull(Hospital.getHospitalId()) ? -1L : Hospital.getHospitalId();
|
||||
SysHospital info = hospitalMapper.checkHospitalCodeUnique(Hospital.getHospitalCode());
|
||||
if (StringUtils.isNotNull(info) && info.getHospitalId().longValue() != HospitalId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过医疗机构ID查询医疗机构使用数量
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int countUserHospitalById(Long HospitalId) {
|
||||
return 0;//hospitalMapper.countUserHospitalById(HospitalId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除医疗机构信息
|
||||
*
|
||||
* @param HospitalId 医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalById(Long HospitalId) {
|
||||
return hospitalMapper.deleteHospitalById(HospitalId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除医疗机构信息
|
||||
*
|
||||
* @param HospitalIds 需要删除的医疗机构ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHospitalByIds(Long[] HospitalIds) {
|
||||
for (Long HospitalId : HospitalIds) {
|
||||
SysHospital Hospital = selectHospitalById(HospitalId);
|
||||
if (countUserHospitalById(HospitalId) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", Hospital.getHospitalName()));
|
||||
}
|
||||
}
|
||||
return hospitalMapper.deleteHospitalByIds(HospitalIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存医疗机构信息
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHospital(SysHospital Hospital) {
|
||||
return hospitalMapper.insertHospital(Hospital);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存医疗机构信息
|
||||
*
|
||||
* @param Hospital 医疗机构信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHospital(SysHospital Hospital) {
|
||||
return hospitalMapper.updateHospital(Hospital);
|
||||
}
|
||||
}
|
||||
124
transitPF/src/main/resources/mapper/SysHospitalMapper.xml
Normal file
124
transitPF/src/main/resources/mapper/SysHospitalMapper.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?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.czlis.transitPF.mapper.SysHospitalMapper">
|
||||
<resultMap type="SysHospital" id="SysHospitalResult">
|
||||
<id property="hospitalId" column="hospital_id" />
|
||||
<result property="hospitalCode" column="hospital_code" />
|
||||
<result property="hospitalName" column="hospital_name" />
|
||||
<result property="hospitalUserinfo" column="hospital_userinfo" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selecthospitalVo">
|
||||
select hospital_id, hospital_code, hospital_name, hospital_userinfo, status, create_by, create_time, remark
|
||||
from sys_hospital
|
||||
</sql>
|
||||
|
||||
<select id="selecthospitalList" parameterType="SysHospital" resultMap="SysHospitalResult">
|
||||
<include refid="selecthospitalVo"/>
|
||||
<where>
|
||||
<if test="hospitalCode != null and hospitalCode != ''">
|
||||
AND hospital_code like '%'+#{hospitalCode}+'%'
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="hospitalName != null and hospitalName != ''">
|
||||
AND hospital_name like '%'+#{hospitalName}+'%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selecthospitalAll" resultMap="SysHospitalResult">
|
||||
<include refid="selecthospitalVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selecthospitalById" parameterType="Long" resultMap="SysHospitalResult">
|
||||
<include refid="selecthospitalVo"/>
|
||||
where hospital_id = #{hospitalId}
|
||||
</select>
|
||||
|
||||
<select id="selecthospitalListByUserId" parameterType="Long" resultType="Long">
|
||||
select p.hospital_id
|
||||
from sys_hospital p
|
||||
left join sys_user_hospital up on up.hospital_id = p.hospital_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selecthospitalsByUserName" parameterType="String" resultMap="SysHospitalResult">
|
||||
select p.hospital_id, p.hospital_name, p.hospital_code
|
||||
from sys_hospital p
|
||||
left join sys_user_hospital up on up.hospital_id = p.hospital_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkhospitalNameUnique" parameterType="String" resultMap="SysHospitalResult">
|
||||
select top 1 hospital_id, hospital_code, hospital_name, hospital_userinfo, status, create_by, create_time, remark
|
||||
from sys_hospital
|
||||
where hospital_name=#{hospitalName}
|
||||
</select>
|
||||
|
||||
<select id="checkhospitalCodeUnique" parameterType="String" resultMap="SysHospitalResult">
|
||||
select top 1 hospital_id, hospital_code, hospital_name, hospital_userinfo, status, create_by, create_time, remark
|
||||
from sys_hospital
|
||||
where hospital_code=#{hospitalCode}
|
||||
</select>
|
||||
|
||||
<update id="updatehospital" parameterType="SysHospital">
|
||||
update sys_hospital
|
||||
<set>
|
||||
<if test="hospitalCode != null and hospitalCode != ''">hospital_code = #{hospitalCode},</if>
|
||||
<if test="hospitalName != null and hospitalName != ''">hospital_name = #{hospitalName},</if>
|
||||
<if test="hospitalUserinfo != null">hospital_userinfo = #{hospitalUserinfo},</if>
|
||||
<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>
|
||||
update_time = getdate()
|
||||
</set>
|
||||
where hospital_id = #{hospitalId}
|
||||
</update>
|
||||
|
||||
<insert id="inserthospital" parameterType="SysHospital" useGeneratedKeys="true" keyProperty="hospitalId">
|
||||
insert into sys_hospital(
|
||||
<if test="hospitalId != null and hospitalId != 0">hospital_id,</if>
|
||||
<if test="hospitalCode != null and hospitalCode != ''">hospital_code,</if>
|
||||
<if test="hospitalName != null and hospitalName != ''">hospital_name,</if>
|
||||
<if test="hospitalUserinfo != null">hospital_userinfo,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="hospitalId != null and hospitalId != 0">#{hospitalId},</if>
|
||||
<if test="hospitalCode != null and hospitalCode != ''">#{hospitalCode},</if>
|
||||
<if test="hospitalName != null and hospitalName != ''">#{hospitalName},</if>
|
||||
<if test="hospitalUserinfo != null">#{hospitalUserinfo},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
getdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletehospitalById" parameterType="Long">
|
||||
delete from sys_hospital where hospital_id = #{hospitalId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletehospitalByIds" parameterType="Long">
|
||||
delete from sys_hospital where hospital_id in
|
||||
<foreach collection="array" item="hospitalId" open="(" separator="," close=")">
|
||||
#{hospitalId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user