parent
223951964b
commit
99fd2ead8b
|
@ -1,9 +1,16 @@
|
||||||
package com.rax.admin.mapper;
|
package com.rax.admin.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.rax.admin.api.dto.HospitalDTO;
|
||||||
import com.rax.admin.api.entity.SysHospital;
|
import com.rax.admin.api.entity.SysHospital;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysHospitalMapper extends BaseMapper<SysHospital> {
|
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
|
@Override
|
||||||
public R<Map> getHospitalList(String name, long offset, long limit) {
|
public R<Map> getHospitalList(String name, long offset, long limit) {
|
||||||
Page<SysHospital> page = new Page<>();
|
List<HospitalDTO> hospitalList = sysHospitalMapper.getHospitalList(limit, offset, name);
|
||||||
page.setSize(limit);
|
Integer hospitalTotal = sysHospitalMapper.getHospitalTotal();
|
||||||
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);
|
|
||||||
|
|
||||||
Map result = new HashMap();
|
Map result = new HashMap();
|
||||||
result.put("count", count);
|
result.put("count", hospitalTotal);
|
||||||
result.put("list", sysHospitals);
|
result.put("list", hospitalList);
|
||||||
return R.ok(result);
|
return R.ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,44 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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">
|
<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>
|
</mapper>
|
|
@ -30,7 +30,6 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||||
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
||||||
threadPoolTaskScheduler.initialize();
|
threadPoolTaskScheduler.initialize();
|
||||||
registry.enableSimpleBroker("/topic").setTaskScheduler(threadPoolTaskScheduler).setHeartbeatValue(heartbeat);
|
registry.enableSimpleBroker("/topic").setTaskScheduler(threadPoolTaskScheduler).setHeartbeatValue(heartbeat);
|
||||||
registry.enableSimpleBroker("/topic");
|
|
||||||
registry.setApplicationDestinationPrefixes("/front");
|
registry.setApplicationDestinationPrefixes("/front");
|
||||||
registry.setUserDestinationPrefix("/topic/user");
|
registry.setUserDestinationPrefix("/topic/user");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user