Browse Source

feat: 汇聚agg_station新增order_num自定义排序

feature/agg
yinhuaiwei 2 weeks ago
parent
commit
6ad6dd9fb5
2 changed files with 6 additions and 3 deletions
  1. +2
    -0
      inspect-main/inspect-main-agg/src/main/java/com/inspect/agg/entity/AggStation.java
  2. +4
    -3
      inspect-main/inspect-main-agg/src/main/resources/mapper/AggStationMapper.xml

+ 2
- 0
inspect-main/inspect-main-agg/src/main/java/com/inspect/agg/entity/AggStation.java View File

@ -28,4 +28,6 @@ public class AggStation {
private String password; private String password;
/** 1启用 0停用 */ /** 1启用 0停用 */
private String enabled; private String enabled;
/** 汇聚自定义显示顺序(数据库手工维护) */
private Integer orderNum;
} }

+ 4
- 3
inspect-main/inspect-main-agg/src/main/resources/mapper/AggStationMapper.xml View File

@ -10,15 +10,16 @@
<result column="username" property="username"/> <result column="username" property="username"/>
<result column="password" property="password"/> <result column="password" property="password"/>
<result column="enabled" property="enabled"/> <result column="enabled" property="enabled"/>
<result column="order_num" property="orderNum"/>
</resultMap> </resultMap>
<select id="selectEnabled" resultMap="BaseResultMap"> <select id="selectEnabled" resultMap="BaseResultMap">
SELECT * FROM agg_station WHERE enabled = 1 ORDER BY id
SELECT * FROM agg_station WHERE enabled = 1 ORDER BY order_num, id
</select> </select>
<select id="selectAllOrdered" resultMap="BaseResultMap"> <select id="selectAllOrdered" resultMap="BaseResultMap">
SELECT * FROM agg_station ORDER BY id
SELECT * FROM agg_station ORDER BY order_num, id
</select> </select>
<select id="selectByCode" resultMap="BaseResultMap"> <select id="selectByCode" resultMap="BaseResultMap">
SELECT * FROM agg_station WHERE station_code = #{stationCode} LIMIT 1 SELECT * FROM agg_station WHERE station_code = #{stationCode} LIMIT 1
@ -29,6 +30,6 @@
<where> <where>
<if test="enabled != null">enabled = #{enabled}</if> <if test="enabled != null">enabled = #{enabled}</if>
</where> </where>
ORDER BY id
ORDER BY order_num, id
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save