83 lines
2.4 KiB
XML
83 lines
2.4 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.baseData.mapper.ScenarioMapper">
|
|
|
|
|
|
<select id="List" resultType="com.hivekion.baseData.entity.Scenario" parameterType="com.hivekion.baseData.entity.Scenario" >
|
|
SELECT
|
|
@rownum := @rownum + 1 AS seq,
|
|
t.Guid,t.Name,t.TestMode,t.Author,t.CreateUserId,t.CreateTime,t.Content,t.id
|
|
FROM (
|
|
SELECT * FROM tbl_scenario
|
|
<where>
|
|
<if test="name != null and name !='' ">
|
|
name LIKE CONCAT('%',#{name},'%')
|
|
</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.baseData.entity.Scenario" >
|
|
select count(id) from tbl_scenario
|
|
<where>
|
|
<if test="name != null and name !=''">
|
|
name LIKE CONCAT('%',#{name},'%')
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="List" resultType="com.hivekion.baseData.entity.Scenario" parameterType="com.hivekion.baseData.entity.Scenario" databaseId="dm">
|
|
select
|
|
t.seq,
|
|
t.Guid,t.Name,t.TestMode,t.Author,t.CreateUserId,t.CreateTime,t.id
|
|
FROM (
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
|
|
a.*
|
|
FROM tbl_scenario a
|
|
<where>
|
|
<if test="name != null and name !='' ">
|
|
(name LIKE '%'||#{name}||'%')
|
|
</if>
|
|
</where>
|
|
) t
|
|
WHERE t.seq > #{start} AND t.seq <= (#{start} + #{pageSize})
|
|
</select>
|
|
|
|
<select id="count" resultType="java.lang.Long" parameterType="com.hivekion.baseData.entity.Scenario" databaseId="dm">
|
|
select count(id) from tbl_scenario
|
|
<where>
|
|
<if test="name != null and name !=''">
|
|
(name LIKE '%'||#{name}||'%')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectByScenarioId" resultType="com.hivekion.baseData.entity.Scenario">
|
|
SELECT
|
|
Guid,
|
|
Name,
|
|
TestMode,
|
|
Author,
|
|
CreateUserId,
|
|
CreateTime,
|
|
start_time As startTime,
|
|
end_time,
|
|
id,
|
|
left_up_lng AS leftUpLng,
|
|
right_up_lng AS rightUpLng,
|
|
left_up_lat AS leftUpLat,
|
|
right_up_lat AS rightUpLat,
|
|
left_bottom_lng AS leftBottomLng,
|
|
right_bottom_lng AS rightBottomLng,
|
|
left_bottom_lat AS leftBottomLat,
|
|
right_bottom_lat AS rightBottomLat
|
|
FROM
|
|
tbl_scenario
|
|
WHERE
|
|
id =#{id}
|
|
</select>
|
|
</mapper>
|