Browse Source

20210222根据项目id查询医院信息

recovery
zy_Java 4 years ago
parent
commit
4f22876714
  1. 28
      tcm/src/main/java/com/ccsens/tcm/api/HospatilController.java
  2. 177
      tcm/src/main/java/com/ccsens/tcm/bean/po/Hospital.java
  3. 1200
      tcm/src/main/java/com/ccsens/tcm/bean/po/HospitalExample.java
  4. 4
      tcm/src/main/java/com/ccsens/tcm/bean/vo/HospitalVo.java
  5. 58
      tcm/src/main/java/com/ccsens/tcm/persist/mapper/HospitalMapper.java
  6. 9
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  7. 31
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  8. 467
      tcm/src/main/resources/mapper_raw/HospitalMapper.xml
  9. 1
      util/src/main/java/com/ccsens/util/CodeEnum.java

28
tcm/src/main/java/com/ccsens/tcm/api/HospatilController.java

@ -1,8 +1,8 @@
package com.ccsens.tcm.api; package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin; import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.BiologicalSamplesDto; import com.ccsens.tcm.bean.dto.PatientDto;
import com.ccsens.tcm.bean.vo.HospatilVo; import com.ccsens.tcm.bean.vo.HospitalVo;
import com.ccsens.tcm.service.IPatientService; import com.ccsens.tcm.service.IPatientService;
import com.ccsens.util.JsonResponse; import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.bean.dto.QueryDto;
@ -11,10 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -29,13 +26,24 @@ import java.util.List;
public class HospatilController { public class HospatilController {
@Resource @Resource
private IPatientService patientService; private IPatientService patientService;
@MustLogin @MustLogin
@ApiOperation(value = "查询医院列表", notes = "w:医院列表查询") @ApiOperation(value = "查询医院列表", notes = "w:医院列表查询")
@RequestMapping(value = "/selHospatil", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/selHospatil", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<HospatilVo.SelHospatilVo>> selHospatil() { public JsonResponse<List<HospitalVo.SelHospitalVo>> selHospatil() {
//log.info("添加生物样本:{}",params);
List<HospatilVo.SelHospatilVo> selHospatilVos= patientService.selHospatil(); List<HospitalVo.SelHospitalVo> selHospitalVos = patientService.selHospatil();
log.info("查询医院列表完成"); log.info("查询医院列表完成");
return JsonResponse.newInstance().ok(selHospatilVos); return JsonResponse.newInstance().ok(selHospitalVos);
}
@ApiOperation(value = "根据项目id查询医院信息", notes = "w:医院列表查询")
@RequestMapping(value = "/selHospatil", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<HospitalVo.SelHospitalVo> getHospitalByProjectId(@ApiParam @RequestParam Long projectId) {
log.info("根据项目id查询医院信息:{}",projectId);
HospitalVo.SelHospitalVo hospitalVo = patientService.getHospitalByProjectId(projectId);
log.info("根据项目id查询医院信息:{}",hospitalVo);
return JsonResponse.newInstance().ok(hospitalVo);
} }
} }

177
tcm/src/main/java/com/ccsens/tcm/bean/po/Hospital.java

@ -1,84 +1,95 @@
package com.ccsens.tcm.bean.po; package com.ccsens.tcm.bean.po;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class Hospital implements Serializable { public class Hospital implements Serializable {
private Long id; private Long id;
private String name; private String name;
private Long operator; private Long operator;
private Date createdAt; private Date createdAt;
private Date updatedAt; private Date updatedAt;
private Byte recStatus; private Byte recStatus;
private static final long serialVersionUID = 1L; private Long projectId;
public Long getId() { private static final long serialVersionUID = 1L;
return id;
} public Long getId() {
return id;
public void setId(Long id) { }
this.id = id;
} public void setId(Long id) {
this.id = id;
public String getName() { }
return name;
} public String getName() {
return name;
public void setName(String name) { }
this.name = name == null ? null : name.trim();
} public void setName(String name) {
this.name = name == null ? null : name.trim();
public Long getOperator() { }
return operator;
} public Long getOperator() {
return operator;
public void setOperator(Long operator) { }
this.operator = operator;
} public void setOperator(Long operator) {
this.operator = operator;
public Date getCreatedAt() { }
return createdAt;
} public Date getCreatedAt() {
return createdAt;
public void setCreatedAt(Date createdAt) { }
this.createdAt = createdAt;
} public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
public Date getUpdatedAt() { }
return updatedAt;
} public Date getUpdatedAt() {
return updatedAt;
public void setUpdatedAt(Date updatedAt) { }
this.updatedAt = updatedAt;
} public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
public Byte getRecStatus() { }
return recStatus;
} public Byte getRecStatus() {
return recStatus;
public void setRecStatus(Byte recStatus) { }
this.recStatus = recStatus;
} public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
@Override }
public String toString() {
StringBuilder sb = new StringBuilder(); public Long getProjectId() {
sb.append(getClass().getSimpleName()); return projectId;
sb.append(" ["); }
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); public void setProjectId(Long projectId) {
sb.append(", name=").append(name); this.projectId = projectId;
sb.append(", operator=").append(operator); }
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt); @Override
sb.append(", recStatus=").append(recStatus); public String toString() {
sb.append("]"); StringBuilder sb = new StringBuilder();
return sb.toString(); sb.append(getClass().getSimpleName());
} sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", projectId=").append(projectId);
sb.append("]");
return sb.toString();
}
} }

1200
tcm/src/main/java/com/ccsens/tcm/bean/po/HospitalExample.java

File diff suppressed because it is too large

4
tcm/src/main/java/com/ccsens/tcm/bean/vo/HospatilVo.java → tcm/src/main/java/com/ccsens/tcm/bean/vo/HospitalVo.java

@ -5,10 +5,10 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class HospatilVo { public class HospitalVo {
@Data @Data
@ApiModel("查询医院列表") @ApiModel("查询医院列表")
public static class SelHospatilVo { public static class SelHospitalVo {
@ApiModelProperty("医院id") @ApiModelProperty("医院id")
private Long id; private Long id;
@ApiModelProperty("医院名称") @ApiModelProperty("医院名称")

58
tcm/src/main/java/com/ccsens/tcm/persist/mapper/HospitalMapper.java

@ -1,30 +1,30 @@
package com.ccsens.tcm.persist.mapper; package com.ccsens.tcm.persist.mapper;
import com.ccsens.tcm.bean.po.Hospital; import com.ccsens.tcm.bean.po.Hospital;
import com.ccsens.tcm.bean.po.HospitalExample; import com.ccsens.tcm.bean.po.HospitalExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
public interface HospitalMapper { public interface HospitalMapper {
long countByExample(HospitalExample example); long countByExample(HospitalExample example);
int deleteByExample(HospitalExample example); int deleteByExample(HospitalExample example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(Hospital record); int insert(Hospital record);
int insertSelective(Hospital record); int insertSelective(Hospital record);
List<Hospital> selectByExample(HospitalExample example); List<Hospital> selectByExample(HospitalExample example);
Hospital selectByPrimaryKey(Long id); Hospital selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Hospital record, @Param("example") HospitalExample example); int updateByExampleSelective(@Param("record") Hospital record, @Param("example") HospitalExample example);
int updateByExample(@Param("record") Hospital record, @Param("example") HospitalExample example); int updateByExample(@Param("record") Hospital record, @Param("example") HospitalExample example);
int updateByPrimaryKeySelective(Hospital record); int updateByPrimaryKeySelective(Hospital record);
int updateByPrimaryKey(Hospital record); int updateByPrimaryKey(Hospital record);
} }

9
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -52,5 +52,12 @@ public interface IPatientService {
PageInfo<BiologicalSamplesVo.selBiolog> selBiologicalSamples(BiologicalSamplesDto.SelBiolog param, Long userId); PageInfo<BiologicalSamplesVo.selBiolog> selBiologicalSamples(BiologicalSamplesDto.SelBiolog param, Long userId);
List<HospatilVo.SelHospatilVo> selHospatil(); List<HospitalVo.SelHospitalVo> selHospatil();
/**
* 根据项目id查询医院信息
* @param projectId 项目id
* @return 返回医院信息
*/
HospitalVo.SelHospitalVo getHospitalByProjectId(Long projectId);
} }

31
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -27,7 +27,6 @@ import javax.annotation.Resource;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -326,17 +325,33 @@ public class PatientService implements IPatientService {
} }
@Override @Override
public List<HospatilVo.SelHospatilVo> selHospatil() { public List<HospitalVo.SelHospitalVo> selHospatil() {
List<HospatilVo.SelHospatilVo> selHospatilVos=new ArrayList<HospatilVo.SelHospatilVo>(); List<HospitalVo.SelHospitalVo> selHospitalVos =new ArrayList<HospitalVo.SelHospitalVo>();
HospitalExample hospitalExample=new HospitalExample(); HospitalExample hospitalExample=new HospitalExample();
hospitalExample.createCriteria().andRecStatusEqualTo((byte)0); hospitalExample.createCriteria().andRecStatusEqualTo((byte)0);
List<Hospital> hospitals = hospitalMapper.selectByExample(hospitalExample); List<Hospital> hospitals = hospitalMapper.selectByExample(hospitalExample);
hospitals.forEach(hospital -> { hospitals.forEach(hospital -> {
HospatilVo.SelHospatilVo selHospatilVo=new HospatilVo.SelHospatilVo(); HospitalVo.SelHospitalVo selHospitalVo =new HospitalVo.SelHospitalVo();
selHospatilVo.setId(hospital.getId()); selHospitalVo.setId(hospital.getId());
selHospatilVo.setName(hospital.getName()); selHospitalVo.setName(hospital.getName());
selHospatilVos.add(selHospatilVo); selHospitalVos.add(selHospitalVo);
}); });
return selHospatilVos; return selHospitalVos;
}
@Override
public HospitalVo.SelHospitalVo getHospitalByProjectId(Long projectId) {
HospitalVo.SelHospitalVo selHospitalVo = new HospitalVo.SelHospitalVo();
HospitalExample hospitalExample=new HospitalExample();
hospitalExample.createCriteria().andProjectIdEqualTo(projectId);
List<Hospital> hospitals = hospitalMapper.selectByExample(hospitalExample);
if(CollectionUtil.isNotEmpty(hospitals)){
selHospitalVo.setId(hospitals.get(0).getId());
selHospitalVo.setName(hospitals.get(0).getName());
}else {
throw new BaseException(CodeEnum.NOT_HOSPITAL);
}
return selHospitalVo;
} }
} }

467
tcm/src/main/resources/mapper_raw/HospitalMapper.xml

@ -1,226 +1,243 @@
<?xml version="1.0" encoding="UTF-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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tcm.persist.mapper.HospitalMapper"> <mapper namespace="com.ccsens.tcm.persist.mapper.HospitalMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tcm.bean.po.Hospital"> <resultMap id="BaseResultMap" type="com.ccsens.tcm.bean.po.Hospital">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="operator" jdbcType="BIGINT" property="operator" /> <result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> <result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap> <result column="project_id" jdbcType="BIGINT" property="projectId" />
<sql id="Example_Where_Clause"> </resultMap>
<where> <sql id="Example_Where_Clause">
<foreach collection="oredCriteria" item="criteria" separator="or"> <where>
<if test="criteria.valid"> <foreach collection="oredCriteria" item="criteria" separator="or">
<trim prefix="(" prefixOverrides="and" suffix=")"> <if test="criteria.valid">
<foreach collection="criteria.criteria" item="criterion"> <trim prefix="(" prefixOverrides="and" suffix=")">
<choose> <foreach collection="criteria.criteria" item="criterion">
<when test="criterion.noValue"> <choose>
and ${criterion.condition} <when test="criterion.noValue">
</when> and ${criterion.condition}
<when test="criterion.singleValue"> </when>
and ${criterion.condition} #{criterion.value} <when test="criterion.singleValue">
</when> and ${criterion.condition} #{criterion.value}
<when test="criterion.betweenValue"> </when>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} <when test="criterion.betweenValue">
</when> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<when test="criterion.listValue"> </when>
and ${criterion.condition} <when test="criterion.listValue">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> and ${criterion.condition}
#{listItem} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</foreach> </choose>
</trim> </foreach>
</if> </trim>
</foreach> </if>
</where> </foreach>
</sql> </where>
<sql id="Update_By_Example_Where_Clause"> </sql>
<where> <sql id="Update_By_Example_Where_Clause">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <where>
<if test="criteria.valid"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<trim prefix="(" prefixOverrides="and" suffix=")"> <if test="criteria.valid">
<foreach collection="criteria.criteria" item="criterion"> <trim prefix="(" prefixOverrides="and" suffix=")">
<choose> <foreach collection="criteria.criteria" item="criterion">
<when test="criterion.noValue"> <choose>
and ${criterion.condition} <when test="criterion.noValue">
</when> and ${criterion.condition}
<when test="criterion.singleValue"> </when>
and ${criterion.condition} #{criterion.value} <when test="criterion.singleValue">
</when> and ${criterion.condition} #{criterion.value}
<when test="criterion.betweenValue"> </when>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} <when test="criterion.betweenValue">
</when> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<when test="criterion.listValue"> </when>
and ${criterion.condition} <when test="criterion.listValue">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> and ${criterion.condition}
#{listItem} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</foreach> </choose>
</trim> </foreach>
</if> </trim>
</foreach> </if>
</where> </foreach>
</sql> </where>
<sql id="Base_Column_List"> </sql>
id, name, operator, created_at, updated_at, rec_status <sql id="Base_Column_List">
</sql> id, name, operator, created_at, updated_at, rec_status, project_id
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample" resultMap="BaseResultMap"> </sql>
select <select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample" resultMap="BaseResultMap">
<if test="distinct"> select
distinct <if test="distinct">
</if> distinct
<include refid="Base_Column_List" /> </if>
from t_hospital <include refid="Base_Column_List" />
<if test="_parameter != null"> from t_hospital
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause" />
<if test="orderByClause != null"> </if>
order by ${orderByClause} <if test="orderByClause != null">
</if> order by ${orderByClause}
</select> </if>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> </select>
select <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<include refid="Base_Column_List" /> select
from t_hospital <include refid="Base_Column_List" />
where id = #{id,jdbcType=BIGINT} from t_hospital
</select> where id = #{id,jdbcType=BIGINT}
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> </select>
delete from t_hospital <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
where id = #{id,jdbcType=BIGINT} delete from t_hospital
</delete> where id = #{id,jdbcType=BIGINT}
<delete id="deleteByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample"> </delete>
delete from t_hospital <delete id="deleteByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample">
<if test="_parameter != null"> delete from t_hospital
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause" />
</delete> </if>
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.Hospital"> </delete>
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <insert id="insert" parameterType="com.ccsens.tcm.bean.po.Hospital">
SELECT LAST_INSERT_ID() insert into t_hospital (id, name, operator,
</selectKey> created_at, updated_at, rec_status,
insert into t_hospital (name, operator, created_at, project_id)
updated_at, rec_status) values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
values (#{name,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) #{projectId,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.Hospital"> <insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.Hospital">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> insert into t_hospital
SELECT LAST_INSERT_ID() <trim prefix="(" suffix=")" suffixOverrides=",">
</selectKey> <if test="id != null">
insert into t_hospital id,
<trim prefix="(" suffix=")" suffixOverrides=","> </if>
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
<if test="operator != null"> <if test="operator != null">
operator, operator,
</if> </if>
<if test="createdAt != null"> <if test="createdAt != null">
created_at, created_at,
</if> </if>
<if test="updatedAt != null"> <if test="updatedAt != null">
updated_at, updated_at,
</if> </if>
<if test="recStatus != null"> <if test="recStatus != null">
rec_status, rec_status,
</if> </if>
</trim> <if test="projectId != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> project_id,
<if test="name != null"> </if>
#{name,jdbcType=VARCHAR}, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="operator != null"> <if test="id != null">
#{operator,jdbcType=BIGINT}, #{id,jdbcType=BIGINT},
</if> </if>
<if test="createdAt != null"> <if test="name != null">
#{createdAt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR},
</if> </if>
<if test="updatedAt != null"> <if test="operator != null">
#{updatedAt,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT},
</if> </if>
<if test="recStatus != null"> <if test="createdAt != null">
#{recStatus,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
</if> </if>
</trim> <if test="updatedAt != null">
</insert> #{updatedAt,jdbcType=TIMESTAMP},
<select id="countByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample" resultType="java.lang.Long"> </if>
select count(*) from t_hospital <if test="recStatus != null">
<if test="_parameter != null"> #{recStatus,jdbcType=TINYINT},
<include refid="Example_Where_Clause" /> </if>
</if> <if test="projectId != null">
</select> #{projectId,jdbcType=BIGINT},
<update id="updateByExampleSelective" parameterType="map"> </if>
update t_hospital </trim>
<set> </insert>
<if test="record.id != null"> <select id="countByExample" parameterType="com.ccsens.tcm.bean.po.HospitalExample" resultType="java.lang.Long">
id = #{record.id,jdbcType=BIGINT}, select count(*) from t_hospital
</if> <if test="_parameter != null">
<if test="record.name != null"> <include refid="Example_Where_Clause" />
name = #{record.name,jdbcType=VARCHAR}, </if>
</if> </select>
<if test="record.operator != null"> <update id="updateByExampleSelective" parameterType="map">
operator = #{record.operator,jdbcType=BIGINT}, update t_hospital
</if> <set>
<if test="record.createdAt != null"> <if test="record.id != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, id = #{record.id,jdbcType=BIGINT},
</if> </if>
<if test="record.updatedAt != null"> <if test="record.name != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, name = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.recStatus != null"> <if test="record.operator != null">
rec_status = #{record.recStatus,jdbcType=TINYINT}, operator = #{record.operator,jdbcType=BIGINT},
</if> </if>
</set> <if test="record.createdAt != null">
<if test="_parameter != null"> created_at = #{record.createdAt,jdbcType=TIMESTAMP},
<include refid="Update_By_Example_Where_Clause" /> </if>
</if> <if test="record.updatedAt != null">
</update> updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
<update id="updateByExample" parameterType="map"> </if>
update t_hospital <if test="record.recStatus != null">
set id = #{record.id,jdbcType=BIGINT}, rec_status = #{record.recStatus,jdbcType=TINYINT},
name = #{record.name,jdbcType=VARCHAR}, </if>
operator = #{record.operator,jdbcType=BIGINT}, <if test="record.projectId != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, project_id = #{record.projectId,jdbcType=BIGINT},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, </if>
rec_status = #{record.recStatus,jdbcType=TINYINT} </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tcm.bean.po.Hospital"> <update id="updateByExample" parameterType="map">
update t_hospital update t_hospital
<set> set id = #{record.id,jdbcType=BIGINT},
<if test="name != null"> name = #{record.name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, operator = #{record.operator,jdbcType=BIGINT},
</if> created_at = #{record.createdAt,jdbcType=TIMESTAMP},
<if test="operator != null"> updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
operator = #{operator,jdbcType=BIGINT}, rec_status = #{record.recStatus,jdbcType=TINYINT},
</if> project_id = #{record.projectId,jdbcType=BIGINT}
<if test="createdAt != null"> <if test="_parameter != null">
created_at = #{createdAt,jdbcType=TIMESTAMP}, <include refid="Update_By_Example_Where_Clause" />
</if> </if>
<if test="updatedAt != null"> </update>
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, <update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tcm.bean.po.Hospital">
</if> update t_hospital
<if test="recStatus != null"> <set>
rec_status = #{recStatus,jdbcType=TINYINT}, <if test="name != null">
</if> name = #{name,jdbcType=VARCHAR},
</set> </if>
where id = #{id,jdbcType=BIGINT} <if test="operator != null">
</update> operator = #{operator,jdbcType=BIGINT},
<update id="updateByPrimaryKey" parameterType="com.ccsens.tcm.bean.po.Hospital"> </if>
update t_hospital <if test="createdAt != null">
set name = #{name,jdbcType=VARCHAR}, created_at = #{createdAt,jdbcType=TIMESTAMP},
operator = #{operator,jdbcType=BIGINT}, </if>
created_at = #{createdAt,jdbcType=TIMESTAMP}, <if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT} </if>
where id = #{id,jdbcType=BIGINT} <if test="recStatus != null">
</update> rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tcm.bean.po.Hospital">
update t_hospital
set name = #{name,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
project_id = #{projectId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>

1
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -182,6 +182,7 @@ public enum CodeEnum {
ALREADY_UPLOAD_FORM(151,"请勿重复提交信息",true), ALREADY_UPLOAD_FORM(151,"请勿重复提交信息",true),
MESSAGEISNULL(152,"数据为空",true), MESSAGEISNULL(152,"数据为空",true),
QUANTITYERROR(153,"住院号和患者id不对应",true), QUANTITYERROR(153,"住院号和患者id不对应",true),
NOT_HOSPITAL(154,"未找到医院信息",true),
; ;

Loading…
Cancel
Save