修改就诊记录日期查询及添加患者手机号唯一校验

master
chenfei 2 years ago
parent 97624a399a
commit 73fb025a5f

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.api;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@ -173,6 +174,9 @@ public class AppController extends BaseController
{
TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient);
if(UserConstants.NOT_UNIQUE.equals(tPatientService.checkPhoneUnique(tPatient.getPhone()))){
return AjaxResult.error("手机号已注册");
}
tPatientService.insertTPatient(tPatient);
Long identifier = 10000000L + tPatient.getId();
tPatient.setIdentifier(String.valueOf(identifier));

@ -43,10 +43,10 @@ public class TRecordResultReq
@ApiModelProperty("待诊日期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
private String startTime;
@ApiModelProperty("待诊日期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private String endTime;
public String getName()
{
@ -149,22 +149,22 @@ public class TRecordResultReq
this.createTime = createTime;
}
public Date getStartTime()
public String getStartTime()
{
return startTime;
}
public void setStartTime(Date startTime)
public void setStartTime(String startTime)
{
this.startTime = startTime;
}
public Date getEndTime()
public String getEndTime()
{
return endTime;
}
public void setEndTime(Date endTime)
public void setEndTime(String endTime)
{
this.endTime = endTime;
}

@ -65,4 +65,6 @@ public interface TPatientMapper
public TPatient queryTPatient(TPatient tPatient);
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
int checkPhoneUnique(String phone);
}

@ -62,4 +62,6 @@ public interface ITPatientService
public int deleteTPatientById(Long id);
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
String checkPhoneUnique(String phone);
}

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.PcTPatintQueryByPageReq;
import com.ruoyi.system.domain.resp.PcTPatientQueryByPageResp;
@ -100,4 +102,15 @@ public class TPatientServiceImpl implements ITPatientService
public List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq) {
return tPatientMapper.queryByPage(pcTPatintQueryByPageReq);
}
@Override
public String checkPhoneUnique(String phone)
{
int count = tPatientMapper.checkPhoneUnique(phone);
if (count > 0)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

@ -152,4 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by a.create_time desc
</select>
<select id="checkPhoneUnique" parameterType="String" resultType="int">
select count(1) from t_patient where phone = #{phone} limit 1
</select>
</mapper>

@ -202,10 +202,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">
and DATE_FORMAT(tp.create_time,'%Y-%m') = DATE_FORMAT(#{createTime},'%Y-%m')
</if>
<if test="startTime != null and endTime != null">
AND tr.create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="startTime != null and endTime != null"></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 != null "> and tr.create_time between #{startTime} and #{endTime}</if>
<if test="doctorOder !=null and firstVisitOder!=null" >order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder}</if>
</where>
</select>

Loading…
Cancel
Save