Newer
Older
huludao / src / main / resources / mapper / ProvisionalSurveyDataDao.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.newfiber.api.pc.dao.newmonitoring.ProvisionalSurveyDataDao">

<!--    <insert id="insert" parameterType="com.xf.monitor.model.ProvisionalSurveyData">
        INSERT INTO provisional_survey_data(siteNo,tt,cod) VALUES
        <foreach collection="provisionalSurveyDatas" item="provisionalSurveyData" separator=",">
            (#{provisionalSurveyData.siteNo},#{provisionalSurveyData.tt},#{provisionalSurveyData.cod})
        </foreach>
    </insert>-->

    <select id="getDatas" resultType="com.newfiber.api.pc.model.monitor.ProvisionalSurveyData">
        SELECT siteNo,tt,cod FROM nf_monitor.provisional_survey_data where tt in
        <foreach collection="dates" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
        AND siteNo = #{siteNo}
    </select>
    <select id="getDatasBySe" resultType="com.newfiber.api.pc.model.monitor.ProvisionalSurveyData">
        SELECT siteNo,tt,cod FROM nf_monitor.provisional_survey_data where tt BETWEEN #{st} and #{et}
        AND siteNo = #{siteNo}
    </select>
    <select id="getDatasSN" resultType="com.newfiber.api.pc.model.monitor.ProvisionalSurveyData">
        SELECT siteNo,tt,cod FROM nf_monitor.provisional_survey_data where tt BETWEEN #{st} and #{et}
        AND siteNo = #{siteNo}
    </select>

    <select id="countCod" resultType="int">
        SELECT count(1) FROM nf_monitor.provisional_survey_data WHERE siteNo = #{siteNo} and cod is not null
    </select>
</mapper>