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 | 81 +++++++++++++++++++++++-----------------
1 files changed, 47 insertions(+), 34 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 c7da490..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,32 +27,38 @@
from ba_block
where id = #{id,jdbcType=BIGINT}
</select>
- <select id="selectTotal" parameterType="java.lang.Long" resultType="java.lang.Long">
- <!--@mbg.generated-->
+
+ <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 ">
- <if test="name != null">
- name like '%#{name,jdbcType=VARCHAR}%' and
- </if>
- <if test="header != null">
- header = '#{header,jdbcType=VARCHAR}' and
- </if>
- <if test="phone != null">
- phone = '#{phone,jdbcType=VARCHAR}' and
- </if>
- <if test="area != null">
- area = #{area,jdbcType=INTEGER}
- </if>
- </trim>
+ <trim prefix="where " suffixOverrides="and">
+ <if test="name != null">
+ name like '%#{name,jdbcType=VARCHAR}%' and
+ </if>
+ <if test="header != null">
+ header = '#{header,jdbcType=VARCHAR}' and
+ </if>
+ <if test="phone != null">
+ phone = '#{phone,jdbcType=VARCHAR}' and
+ </if>
+ <if test="area != null">
+ area = #{area,jdbcType=INTEGER} and
+ </if>
+ </trim>
</select>
<select id="selectSome" parameterType="java.util.Map" resultMap="BaseResultMap">
<!--@mbg.generated-->
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>
@@ -59,26 +69,17 @@
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
<trim prefix="limit " >
- <if test="queryStart != null and queryCount != null">
- #{queryStart}, #{queryCount}
+ <if test="start != null and count != null">
+ #{start}, #{count}
</if>
</trim>
</select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- delete from ba_block
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <delete id="deleteLogicById" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- update ba_block set deleted = 1
- where id = #{id,jdbcType=BIGINT}
- </delete>
<insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaBlock">
<!--@mbg.generated-->
insert into ba_block (id, `name`, `header`, phone, area, color, deleted)
@@ -88,7 +89,7 @@
#{phone,jdbcType=VARCHAR},
#{area,jdbcType=INTEGER},
#{color,jdbcType=VARCHAR},
- #{deleted,jdbcType=TINYINT})
+ #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaBlock">
<!--@mbg.generated-->
@@ -136,7 +137,7 @@
#{color,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
- #{deleted,jdbcType=TINYINT},
+ #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
</if>
</trim>
</insert>
@@ -160,7 +161,7 @@
color = #{color,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
- color = #{deleted,jdbcType=TINYINT},
+ color = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@@ -173,7 +174,19 @@
phone = #{phone,jdbcType=VARCHAR},
area = #{area,jdbcType=INTEGER},
color = #{color,jdbcType=VARCHAR},
- deleted = #{deleted,jdbcType=TINYINT}
+ deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
+
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete from ba_block
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <delete id="deleteLogicById" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ update ba_block set deleted = 1
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0