mirror of
https://gitee.com/republicline/rax-remote-v2.git
synced 2025-08-24 04:04:57 +08:00
parent
223951964b
commit
99fd2ead8b
|
@ -1,9 +1,16 @@
|
|||
package com.rax.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.rax.admin.api.dto.HospitalDTO;
|
||||
import com.rax.admin.api.entity.SysHospital;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysHospitalMapper extends BaseMapper<SysHospital> {
|
||||
List<HospitalDTO> getHospitalList(@Param("limit") Long limit, @Param("offset") Long offset, @Param("name") String name);
|
||||
|
||||
Integer getHospitalTotal();
|
||||
}
|
||||
|
|
|
@ -54,29 +54,12 @@ public class SysHospitalServiceImpl extends ServiceImpl<SysHospitalMapper, SysHo
|
|||
|
||||
@Override
|
||||
public R<Map> getHospitalList(String name, long offset, long limit) {
|
||||
Page<SysHospital> page = new Page<>();
|
||||
page.setSize(limit);
|
||||
page.setCurrent(offset);
|
||||
|
||||
QueryWrapper<SysHospital> queryWrapper = new QueryWrapper<>();
|
||||
if (StringUtils.hasText(name)) {
|
||||
queryWrapper.checkSqlInjection().like("name", name);
|
||||
}
|
||||
queryWrapper.eq("deleted", 0);
|
||||
|
||||
List<OrderItem> orderItems = new ArrayList<>();
|
||||
OrderItem createTimeOrder = new OrderItem();
|
||||
createTimeOrder.setColumn("create_time");
|
||||
createTimeOrder.setAsc(false);
|
||||
orderItems.add(createTimeOrder);
|
||||
page.setOrders(orderItems);
|
||||
|
||||
List<SysHospital> sysHospitals = sysHospitalMapper.selectList(page, queryWrapper);
|
||||
Long count = sysHospitalMapper.selectCount(queryWrapper);
|
||||
List<HospitalDTO> hospitalList = sysHospitalMapper.getHospitalList(limit, offset, name);
|
||||
Integer hospitalTotal = sysHospitalMapper.getHospitalTotal();
|
||||
|
||||
Map result = new HashMap();
|
||||
result.put("count", count);
|
||||
result.put("list", sysHospitals);
|
||||
result.put("count", hospitalTotal);
|
||||
result.put("list", hospitalList);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,44 @@
|
|||
<?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">
|
||||
<mapper namespace="com.rax.admin.mapper.SysHospitalMapper">
|
||||
<sql id="hospitalPropertiesSQL">
|
||||
id,
|
||||
name,
|
||||
code,
|
||||
status,
|
||||
province,
|
||||
city
|
||||
</sql>
|
||||
|
||||
<sql id="hospitalSelectSQL">
|
||||
|
||||
FROM sys_hostipal
|
||||
|
||||
WHERE deleted = 0
|
||||
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="bindName" value="'%' + name + '%'"/>
|
||||
AND name LIKE '#{bindName}'
|
||||
</if>
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="getHospitalList" resultType="com.rax.admin.api.dto.HospitalDTO">
|
||||
SELECT
|
||||
|
||||
<include refid="hospitalPropertiesSQL"/>
|
||||
|
||||
<include refid="hospitalSelectSQL"/>
|
||||
|
||||
order by create_time desc
|
||||
|
||||
limit #{offset},#{limit}
|
||||
</select>
|
||||
|
||||
<select id="getHospitalTotal" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
<include refid="hospitalSelectSQL"/>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -30,7 +30,6 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
|||
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
||||
threadPoolTaskScheduler.initialize();
|
||||
registry.enableSimpleBroker("/topic").setTaskScheduler(threadPoolTaskScheduler).setHeartbeatValue(heartbeat);
|
||||
registry.enableSimpleBroker("/topic");
|
||||
registry.setApplicationDestinationPrefixes("/front");
|
||||
registry.setUserDestinationPrefix("/topic/user");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user