From 2833093ddc4d191f94c0b7f456d05d302e311dc5 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 16 十一月 2023 20:15:49 +0800 Subject: [PATCH] 增加查询全部片区功能 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml index 46df3bd..b836678 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml @@ -16,6 +16,10 @@ <!--@mbg.generated--> id, `name`, `header`, phone, area, color,deleted </sql> + <sql id="part_Column_List"> + <!--@mbg.generated--> + id, `name` + </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <!--@mbg.generated--> select @@ -23,11 +27,18 @@ from ba_block where id = #{id,jdbcType=BIGINT} </select> - <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> + + <select id="selectAll" resultMap="BaseResultMap"> + select + <include refid="part_Column_List" /> + from ba_block + </select> + +<select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> select count(*) from ba_block - <trim prefix="where "> + <trim prefix="where " suffixOverrides="and"> <if test="name != null"> name like '%#{name,jdbcType=VARCHAR}%' and </if> @@ -38,7 +49,7 @@ phone = '#{phone,jdbcType=VARCHAR}' and </if> <if test="area != null"> - area = #{area,jdbcType=INTEGER} + area = #{area,jdbcType=INTEGER} and </if> </trim> </select> @@ -47,7 +58,7 @@ select <include refid="Base_Column_List" /> from ba_block - <trim prefix="where "> + <trim prefix="where " suffixOverrides="and"> <if test="name != null"> name like '%#{name,jdbcType=VARCHAR}%' and </if> @@ -58,7 +69,7 @@ phone = '#{phone,jdbcType=VARCHAR}' and </if> <if test="area != null"> - area = #{area,jdbcType=INTEGER} + area = #{area,jdbcType=INTEGER} and </if> </trim> order by id DESC -- Gitblit v1.8.0