修改app条件查询

master
chenfei 2 years ago
parent 1684767691
commit fce83bbcec

@ -17,8 +17,8 @@ public class TRecordResultReq
private String name; private String name;
@ApiModelProperty("患者性别") @ApiModelProperty("患者性别")
private String sex; private String sex;
@ApiModelProperty("患者年龄") @ApiModelProperty("患者年龄范围字符串")
private Integer age; private String age;
@ApiModelProperty("档案号") @ApiModelProperty("档案号")
private String identifier; private String identifier;
@ApiModelProperty("医生id") @ApiModelProperty("医生id")
@ -28,9 +28,8 @@ public class TRecordResultReq
@ApiModelProperty("医院id") @ApiModelProperty("医院id")
private Long hospitalId; private Long hospitalId;
@JsonFormat(pattern = "yyyy-MM")
@ApiModelProperty("初诊日期查询 到月份") @ApiModelProperty("初诊日期查询 到月份")
private Date createTime; private String createTime;
@ApiModelProperty("注册日期排序(必传)asc 正序desc 倒序") @ApiModelProperty("注册日期排序(必传)asc 正序desc 倒序")
//预约时间排序 //预约时间排序
@ -71,12 +70,12 @@ public class TRecordResultReq
this.sex = sex; this.sex = sex;
} }
public Integer getAge() public String getAge()
{ {
return age; return age;
} }
public void setAge(Integer age) public void setAge(String age)
{ {
this.age = age; this.age = age;
} }
@ -142,12 +141,12 @@ public class TRecordResultReq
this.firstVisitOder = firstVisitOder; this.firstVisitOder = firstVisitOder;
} }
public Date getCreateTime() public String getCreateTime()
{ {
return createTime; return createTime;
} }
public void setCreateTime(Date createTime) public void setCreateTime(String createTime)
{ {
this.createTime = createTime; this.createTime = createTime;
} }

@ -197,14 +197,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hospitalId != null "> and tr.hospital_id = #{hospitalId}</if> <if test="hospitalId != null "> and tr.hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and tr.status = #{status}</if> <if test="status != null and status != ''"> and tr.status = #{status}</if>
<if test="doctorName != null and doctorName != ''"> and td.name like concat('%', #{doctorName}, '%')</if> <if test="doctorName != null and doctorName != ''"> and td.name like concat('%', #{doctorName}, '%')</if>
<if test="age !=null">and tp.age = #{age} </if> <if test="age !=null">
and tp.age between
<foreach item="item" collection="age.split('-')" separator="and">
#{item}
</foreach>
</if>
<if test="sex !=null">and tp.sex = #{sex} </if> <if test="sex !=null">and tp.sex = #{sex} </if>
<if test="identifier !=null">and tp.identifier like concat('%', #{identifier}, '%')</if> <if test="identifier !=null">and tp.identifier like concat('%', #{identifier}, '%')</if>
<if test="delFlag == null"> <if test="delFlag == null">
and td.del_flag = '0' and tp.del_flag = '0' and td.del_flag = '0' and tp.del_flag = '0'
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
and DATE_FORMAT(tp.create_time,'%Y-%m') = DATE_FORMAT(#{createTime},'%Y-%m') and DATE_FORMAT(tp.create_time,'%Y-%m') = #{createTime}
</if> </if>
<if test="startTime != null and startTime != '' and endTime == null "> and tr.create_time &gt;= #{startTime}</if> <if test="startTime != null and startTime != '' and endTime == null "> and tr.create_time &gt;= #{startTime}</if>
<if test="startTime == null and endTime != '' and endTime != null "> and tr.create_time &lt;= #{endTime}</if> <if test="startTime == null and endTime != '' and endTime != null "> and tr.create_time &lt;= #{endTime}</if>

Loading…
Cancel
Save