Browse Source

代码修改

LAPTOP-KB9HII50\70708 1 year ago
parent
commit
a119a6d2a5

+ 9 - 4
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -211,7 +211,8 @@ public class ImService {
     * @param doctorName 医生名字
     * @return
     */
    public List<Map<String, Object>> findConsultRecordByPatient(String patient, String id, String type, int page, int pagesize, String title, Integer status, Integer payStatus, String doctorName) {
    public List<Map<String, Object>> findConsultRecordByPatient(String patient, String id, String type, int page, int pagesize,
                                                                String title, Integer status, Integer payStatus, String doctorName, String doctorId) {
        String sql = "SELECT " +
@ -250,7 +251,9 @@ public class ImService {
                "WHERE a.id=b.consult and d.id = h.doctor_code " +
                "AND b.doctor=d.id and p.id=a.patient AND a.patient='" + patient + "' AND a.type in (" + type + ")";
        /*List<ConsultVO> result = new ArrayList<>();*/
        if (!StringUtils.isEmpty(doctorId)) {
            sql += " and d.id = '" + doctorId + "'";
        }
        if (!StringUtils.isEmpty(title)) {
            title = "%" + title + "%";
            sql += " and a.title like '" + title + "'";
@ -300,7 +303,7 @@ public class ImService {
     * @param title   标题关键字
     * @return
     */
    public Long countConsultRecordByPatient(String patient, String id, String type, String title) {
    public Long countConsultRecordByPatient(String patient, String id, String type, String title, String doctorId) {
        String sql = "SELECT " +
                " COUNT(1) AS \"total\" " +
@ -318,7 +321,9 @@ public class ImService {
        if (!StringUtils.isEmpty(id)) {
            sql += " and a.id = '" + id + "'";
        }
        if (!StringUtils.isEmpty(doctorId)) {
            sql += " and d.id = '" + doctorId + "'";
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -166,6 +166,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	public Envelop records(
								@ApiParam(name = "patient", value = "居民id")
								@RequestParam(value = "patient",required = true) String patient,
								@ApiParam(name = "doctorId", value = "医生id",required = false)
								@RequestParam(value = "doctorId",required = false) String doctorId,
								@ApiParam(name = "title", value = "咨询标题关键字")
								@RequestParam(value = "title",required = false) String title,
								@ApiParam(name = "id", value = "咨询ID")
@ -184,8 +186,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@RequestParam(value = "doctorName",required = false) String doctorName
								){
		try {
			List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus,doctorName);
			Long total = imService.countConsultRecordByPatient(patient, id,type,title);
			List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus,doctorName,doctorId);
			Long total = imService.countConsultRecordByPatient(patient, id,type,title,doctorId);
			JSONObject result = new JSONObject();
			result.put("total",total);