63 lines
2.1 KiB
XML
63 lines
2.1 KiB
XML
<?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.hivekion.scenario.mapper.ScenarioRoomMapper">
|
|
<resultMap id="DMScenarioRoom" type="com.hivekion.scenario.entity.ScenarioRoom">
|
|
<result property="roomName" column="ROOM_NAME"/>
|
|
<result property="scenarioId" column="SCENARIO_ID"/>
|
|
<result property="userId" column="USER_ID"/>
|
|
<result property="createTime" column="CREATE_TIME"/>
|
|
</resultMap>
|
|
<select id="list" resultType="com.hivekion.scenario.entity.ScenarioRoom" parameterType="com.hivekion.scenario.entity.ScenarioRoom" >
|
|
SELECT
|
|
@rownum := @rownum + 1 AS seq,
|
|
*
|
|
FROM (
|
|
SELECT * FROM tbl_scenario_room
|
|
<where>
|
|
<if test="scenarioId != null and scenarioId !='' ">
|
|
and SCENARIO_ID =#{scenarioId}
|
|
</if>
|
|
</where>
|
|
order by id asc ) t, ( SELECT @rownum := #{start} ) r limit
|
|
#{start},#{pageSize}
|
|
</select>
|
|
|
|
<select id="count" resultType="java.lang.Long" parameterType="com.hivekion.scenario.entity.ScenarioRoom" >
|
|
select count(id) from tbl_scenario_room
|
|
<where>
|
|
<if test="scenarioId != null and scenarioId !='' ">
|
|
and SCENARIO_ID =#{scenarioId}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="list" resultMap="DMScenarioRoom" parameterType="com.hivekion.scenario.entity.ScenarioRoom" databaseId="dm">
|
|
select
|
|
t.seq,
|
|
t.*
|
|
FROM (
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
|
|
a.*
|
|
FROM tbl_scenario_room a
|
|
<where>
|
|
<if test="scenarioId != null and scenarioId !='' ">
|
|
and SCENARIO_ID =#{scenarioId}
|
|
</if>
|
|
</where>
|
|
) t
|
|
WHERE t.seq > #{start} AND t.seq <= (#{start} + #{pageSize})
|
|
</select>
|
|
|
|
<select id="count" resultType="java.lang.Long" parameterType="com.hivekion.scenario.entity.ScenarioRoom" databaseId="dm">
|
|
select count(id) from tbl_scenario_room
|
|
<where>
|
|
<if test="scenarioId != null and scenarioId !='' ">
|
|
and SCENARIO_ID =#{scenarioId}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|