68 lines
2.0 KiB
XML
68 lines
2.0 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.gis3c.ol.dao.SourceDao">
|
|
<resultMap id="sourceResult" type="com.gis3c.ol.entity.Source">
|
|
<result property="sourceId" column="sourceId" />
|
|
<result property="sourceName" column="sourceName" />
|
|
<result property="type" column="type" />
|
|
<result property="options" column="options" javaType="ObjectJSON"/>
|
|
<result property="description" column="description" />
|
|
</resultMap>
|
|
|
|
<sql id="sourceColumns">
|
|
sourceId
|
|
, sourceName
|
|
, type
|
|
, options
|
|
, description
|
|
</sql>
|
|
|
|
<select id="findAllList" resultMap="sourceResult">
|
|
SELECT
|
|
<include refid="sourceColumns"/>
|
|
FROM c3gis_ol_source;
|
|
</select>
|
|
<select id="findSourcesByPage" resultMap="sourceResult">
|
|
SELECT
|
|
<include refid="sourceColumns"/>
|
|
FROM c3gis_ol_source
|
|
limit #{pageSize, javaType=java.lang.Integer}
|
|
offset #{currentPage, javaType=java.lang.Integer};
|
|
</select>
|
|
|
|
<select id="findSourceById" resultMap="sourceResult">
|
|
SELECT
|
|
<include refid="sourceColumns"/>
|
|
FROM c3gis_ol_source
|
|
WHERE sourceId = #{sourceId, javaType=java.lang.String};
|
|
</select>
|
|
<select id="findSourceByName" resultMap="sourceResult">
|
|
SELECT
|
|
<include refid="sourceColumns"/>
|
|
FROM c3gis_ol_source
|
|
WHERE sourceName = #{sourceName, javaType=java.lang.String};
|
|
</select>
|
|
|
|
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
|
|
INSERT INTO c3gis_ol_source(sourceId
|
|
, sourceName
|
|
, type
|
|
, options
|
|
, description
|
|
)
|
|
VALUES(#{sourceId}
|
|
, #{sourceName}
|
|
, #{type}
|
|
, #{options, javaType=ObjectJSON}::jsonb
|
|
, #{description}
|
|
);
|
|
</insert>
|
|
|
|
<delete id="deleteSourcesById" parameterType="java.util.Set">
|
|
delete from c3gis_ol_source
|
|
WHERE sourceId in
|
|
<foreach collection ="collection" item="item" index="index" open="(" separator="," close=")">
|
|
#{item, javaType=java.lang.String}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |