From 7c9e1e552d171b96e8ec890ba0df5f7abbde1c7d Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期二, 24 九月 2024 15:49:00 +0800 Subject: [PATCH] 优化代码 条件获取流浪控制器接口结果排序优化 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml index 25a5872..915a04f 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml @@ -167,4 +167,57 @@ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_intake_amount_day_last riadl + Left join pr_intake pint on pint.id = riadl.intake_id + <where> + <if test="intakeId != null and intakeId != '' "> + and rash.intake_id = #{intakeId} + </if> + <if test="intakeName != null and intakeName != '' "> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and riadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and riadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getIntakeAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay"> + select + CAST(riadl.intake_id AS char)AS intakeId, + pint.name as intakeName, + riadl.dt as dt, + riadl.amount as amount, + riadl.dt_last as dtLast, + riadl.rtu_addr_last as rtuAddrLast, + CAST(riadl.controller_id_last AS char)AS controllerIdLast, + riadl.total_amount_last as totalAmountLast, + riadl.rtu_dt_last as rtuDtLast + from rm_intake_amount_day_last riadl + Left join pr_intake pint on pint.id = riadl.intake_id + <where> + <if test="intakeId != null and intakeId != '' "> + and rash.intake_id = #{intakeId} + </if> + <if test="intakeName != null and intakeName != '' "> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and riadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and riadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + ORDER BY riadl.id DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0