97 lines
1.8 KiB
XML
97 lines
1.8 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.zcloud.mapper.datasource.anemometer.AnemometerLocalMapper">
|
||
|
|
||
|
<!--模型表名 -->
|
||
|
<sql id="tableName">
|
||
|
bus_anemometer_local
|
||
|
</sql>
|
||
|
|
||
|
<!-- 字段 -->
|
||
|
<sql id="Field">
|
||
|
FLID,
|
||
|
FNAME,
|
||
|
FVALUE,
|
||
|
FTIME
|
||
|
</sql>
|
||
|
|
||
|
<!-- 字段值 -->
|
||
|
<sql id="FieldValue">
|
||
|
#{FLID},
|
||
|
#{FNAME},
|
||
|
#{FVALUE},
|
||
|
#{FTIME}
|
||
|
</sql>
|
||
|
|
||
|
<!-- 批量插入字段值 -->
|
||
|
<sql id="FieldValueBatch">
|
||
|
#{item.FLID},
|
||
|
#{item.FNAME},
|
||
|
#{item.FVALUE},
|
||
|
#{item.FTIME}
|
||
|
</sql>
|
||
|
|
||
|
<!--新增 -->
|
||
|
<insert id="add" parameterType="pd">
|
||
|
insert into
|
||
|
<include refid="tableName"></include>
|
||
|
(
|
||
|
<include refid="Field"></include>
|
||
|
) values (
|
||
|
<include refid="FieldValue"></include>
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<!-- 批量插入 -->
|
||
|
<insert id="BatchinsertInfo" parameterType="pd">
|
||
|
insert into <include refid="tableName"></include>
|
||
|
(
|
||
|
<include refid="Field"></include>
|
||
|
)
|
||
|
values
|
||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||
|
(
|
||
|
<include refid="FieldValueBatch"></include>
|
||
|
)
|
||
|
</foreach>
|
||
|
</insert>
|
||
|
|
||
|
<!--编辑 -->
|
||
|
<update id="edit" parameterType="pd">
|
||
|
update
|
||
|
<include refid="tableName"></include>
|
||
|
set
|
||
|
FNAME =#{FNAME},
|
||
|
FVALUE =#{FVALUE} ,
|
||
|
FTIME=#{FTIME}
|
||
|
where
|
||
|
FLID=#{FLID}
|
||
|
</update>
|
||
|
|
||
|
<!--查询所有 -->
|
||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||
|
select
|
||
|
<include refid="Field"></include>
|
||
|
from
|
||
|
<include refid="tableName"></include>
|
||
|
</select>
|
||
|
|
||
|
<!--查询所有 -->
|
||
|
<select id="findByName" parameterType="pd" resultType="pd">
|
||
|
select
|
||
|
<include refid="Field"></include>
|
||
|
from
|
||
|
<include refid="tableName"></include> f
|
||
|
where
|
||
|
f.FNAME = #{FNAME}
|
||
|
</select>
|
||
|
</mapper>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|