Administrator
2024-07-24 f844554d994465a14e93b0334c2677a37876d7eb
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml
@@ -178,4 +178,53 @@
      rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取记录总数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select count(*)
    from rm_client_amount_day rcad
           Left join se_client sc on sc.id = rcad.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
      </if>
    </where>
    </select>
  <!--根据指定条件获取记录-->
  <select id="getClientAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay">
    select
    CAST(rcad.client_id AS char)AS clientId,
    rcad.amount as amount,
    rcad.money as money,
    rcad.dt as dt,
    rcad.open_dt_last as openDtLast,
    rcad.close_dt_last as closeDtLast,
    rcad.this_amount_last as thisAmountLast,
    rcad.this_money_last as thisMoneyLast,
    rcad.this_time_last as thisTimeLast,
    rcad.rtu_dt_last as rtuDtLast,
    sc.name as clientName
    from rm_client_amount_day rcad
    Left join se_client sc on sc.id = rcad.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
      </if>
    </where>
    ORDER BY rcad.dt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
</mapper>