| New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoTmp.ChangeMapper"> |
| | | |
| | | <!-- 查询出所有取水口 --> |
| | | <select id="selectAllPrIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake"> |
| | | select id as intakeId, |
| | | name as intakeNum |
| | | from pr_intake |
| | | order by id ASC |
| | | </select> |
| | | |
| | | <!-- 取水口取水量日统计相关, 此SQL中的 ”order by id ASC “不可修改 --> |
| | | <select id="selectOneIntakeAllAmountDay" resultType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | dt as dt, |
| | | amount as amount, |
| | | total_amount_last as totalAmountLast |
| | | from rm_intake_amount_day |
| | | where intake_id = #{intakeId} |
| | | order by id ASC |
| | | </select> |
| | | |
| | | <!-- 修改取水口取水量日统计 --> |
| | | <update id="updateOneIntakeAmountDay" > |
| | | update rm_intake_amount_day |
| | | set amount = #{amount, jdbcType=FLOAT} |
| | | where id = #{id, jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteAllIntakeAmountMonth"> |
| | | delete from st_intake_amount_month |
| | | </delete> |
| | | |
| | | <!-- --> |
| | | <select id="statisticAllIntakeAmountMonthFromAmountDay" resultType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | select intake_id as intakeId , |
| | | sum(amount) as amount |
| | | from rm_intake_amount_day |
| | | where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE} |
| | | and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE} |
| | | group by intake_id |
| | | </select> |
| | | |
| | | <insert id="saveOneIntakeAmountMonth" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_month ( |
| | | id, |
| | | intake_id, |
| | | year, |
| | | month, |
| | | amount |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | #{year,jdbcType=INTEGER}, |
| | | #{month,jdbcType=INTEGER}, |
| | | #{amount,jdbcType=FLOAT} |
| | | ) |
| | | </insert> |
| | | |
| | | <delete id="deleteAllIntakeAmountYear"> |
| | | delete from st_intake_amount_year |
| | | </delete> |
| | | |
| | | <!-- --> |
| | | <select id="statisticAllIntakeAmountYearFromAmountDay" resultType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | select intake_id as intakeId , |
| | | sum(amount) as amount |
| | | from rm_intake_amount_day |
| | | where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE} |
| | | and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE} |
| | | group by intake_id |
| | | </select> |
| | | |
| | | <insert id="saveOneIntakeAmountYear" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_year ( |
| | | id, |
| | | intake_id, |
| | | year, |
| | | amount |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | #{year,jdbcType=INTEGER}, |
| | | #{amount,jdbcType=FLOAT} |
| | | ) |
| | | </insert> |
| | | |
| | | </mapper> |