Commit 88d1ff4c authored by fanjr's avatar fanjr

合作医院接口

parent 54f11104
package com.cftech.couponrecord.service;
public interface PdaCouponrecordService {
}
package com.cftech.couponrecord.service.impl;
public class PdaCouponrecordServiceImpl {
}
package com.cftech.couponrecord.web;
public class PdaCouponrecordController {
}
package com.cftech.hospital.dao;
import com.alibaba.fastjson.JSONObject;
import com.cftech.hospital.model.Hospital;
import com.cftech.core.generic.GenericDao;
import com.cftech.hospital.model.HospitalVo;
import java.util.List;
import java.util.Map;
/**
* 合作医院信息Mapper
......@@ -11,4 +16,12 @@ import com.cftech.core.generic.GenericDao;
*/
public interface HospitalMapper extends GenericDao<Hospital> {
/**
* 获取合作项目
* 2021年2月8日 Fanjr
* @param vo
* @return
*/
public List<Map<String,Object>> hospitalList(HospitalVo vo);
}
\ No newline at end of file
......@@ -213,4 +213,18 @@
set del_flag=1
where id = #{id,jdbcType=BIGINT}
</update>
<select id="hospitalList" resultType="map">
SELECT
id,name,telephone,address,longitude,latitude,province,city
from t_aidea_hospital
where del_flag = 0
<if test="name!=null and name !=''">
and name like concat('%',#{name},'%')
</if>
ORDER BY create_time DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page}, #{pageSize}
</if>
</select>
</mapper>
\ No newline at end of file
package com.cftech.hospital.model;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
@Data
public class HospitalVo {
/* 医院名称 */
@ExportConfig(value = "name", width = 100, showLevel = 1)
private String name;
private Long page;
private Long pageSize;
}
package com.cftech.hospital.service;
import com.alibaba.fastjson.JSONObject;
import com.cftech.hospital.model.Hospital;
import com.cftech.core.generic.GenericService;
import com.cftech.hospital.model.HospitalVo;
/**
* 合作医院信息Service
*
......@@ -10,5 +13,10 @@ import com.cftech.core.generic.GenericService;
*/
public interface HospitalService extends GenericService<Hospital> {
/**
* 2021年2月8日
* 获取合作医院列表
*/
JSONObject hospitalList(HospitalVo vo);
}
package com.cftech.hospital.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cftech.hospital.model.Hospital;
import com.cftech.hospital.dao.HospitalMapper;
import com.cftech.hospital.model.HospitalVo;
import com.cftech.hospital.service.HospitalService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.hospital.util.TxMapUtils;
import com.cftech.waybill.utils.CloseableHttpEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 合作医院信息ServiceImpl
*
......@@ -27,5 +34,24 @@ private HospitalMapper hospitalMapper;
public GenericDao<Hospital> getGenericMapper() {
return hospitalMapper;
}
@Override
public JSONObject hospitalList(HospitalVo vo){
JSONObject rtnJson = new JSONObject();
try {
List<Map<String,Object>> list = hospitalMapper.hospitalList(vo);
// CloseableHttpEntity che = TxMapUtils.sendHttpGet("上海市徐汇区漕河泾新兴技术开发区钦州北路1198号智慧园88号楼5层");
if (list != null&&list.size()>0) {
rtnJson.put("errorCode", 0);
rtnJson.put("data", list);
} else {
rtnJson.put("errorCode", 1);
rtnJson.put("errorMsg", "暂无数据");
}
} catch (Exception e) {
e.printStackTrace();
rtnJson.put("errorCode", 1);
rtnJson.put("errorMsg", "合作医院列表" + e.getMessage());
}
return rtnJson;
}
}
\ No newline at end of file
package com.cftech.hospital.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.hospital.model.HospitalVo;
import com.cftech.hospital.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* 2021年2月8日
*/
@RestController
@RequestMapping("/mobile/hosp/hospital")
public class MobileHospitalController {
@Autowired
private HospitalService hospitalService;
/**
* @Author Fanjr
* @Description 获取医院列表
* @Date 2021年1月29日
* @Param
* @return
**/
@RequestMapping(value = "/hospitalList",
method = {RequestMethod.GET, RequestMethod.POST},
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject hospitalList(HospitalVo vo) {
return hospitalService.hospitalList(vo);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment