From 6fee9c7feb67b19c9512aeec59b86d20a86e38bf Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 27 十一月 2023 08:57:00 +0800
Subject: [PATCH] 基础信息分水口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDivideMapper.xml |   72 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDivideMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDivideMapper.xml
index 3aecb4f..89e644f 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDivideMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDivideMapper.xml
@@ -23,6 +23,13 @@
     <!--@mbg.generated-->
     id, `name`, countyId, townId, villageId, blockId, villages, area, `header`, phone, 
     lng, lat, remark, deleted
+  </sql>  <sql id="Base2_Column_List">
+    <!--@mbg.generated-->
+  ${alias}.id, ${alias}.name, ${alias}.countyId, ${alias}.townId, ${alias}.villageId, ${alias}.blockId, ${alias}.villages, ${alias}.area, ${alias}.header, ${alias}.phone, ${alias}.lng, ${alias}.lat, ${alias}.remark
+  </sql>
+  <sql id="part_Column_List">
+    <!--@mbg.generated-->
+    id, `name`
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -31,11 +38,74 @@
     from ba_divide
     where id = #{id,jdbcType=BIGINT}
   </select>
+  <select id="selectAll" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select
+    <include refid="part_Column_List"/>
+    from ba_divide
+  </select>
+  <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long">
+    <!--@mbg.generated-->
+    select
+    count(*)
+    from ba_divide bd
+    left join ba_block bbk on bd.blockId = bbk.id
+    where bd.deleted != 1
+    <trim prefix="and" suffixOverrides="and">
+      <if test="name != null">
+        bd.name like concat('%', #{name}, '%') and
+      </if>
+      <if test="header != null">
+        bd.header = '#{header,jdbcType=VARCHAR}' and
+      </if>
+      <if test="phone != null">
+        bd.phone = '#{phone,jdbcType=VARCHAR}' and
+      </if>
+      <if test="blockName != null">
+        bbk.name like concat('%', #{blockName}, '%') and
+      </if>
+    </trim>
+  </select>
+  <select id="selectSome" parameterType="java.util.Map" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select
+    <include refid="Base2_Column_List" >
+      <property name="alias" value="bd"/>
+    </include>,
+    bbk.name blockName,
+    bdtt.name townName,
+    bdtv.name villageName
+    from ba_divide bd
+    left join ba_block bbk on bd.blockId = bbk.id
+    left join ba_district bdtt on bd.townId=bdtt.id
+    left join ba_district bdtv on bd.villageId=bdtv.id
+    where bd.deleted != 1
+    <trim prefix="and" suffixOverrides="and">
+      <if test="name != null">
+        bd.name like concat('%', #{name}, '%') and
+      </if>
+      <if test="header != null">
+        bd.header = '#{header,jdbcType=VARCHAR}' and
+      </if>
+      <if test="phone != null">
+        bd.phone = '#{phone,jdbcType=VARCHAR}' and
+      </if>
+      <if test="blockName != null">
+        bbk.name like concat('%', #{blockName}, '%') and
+      </if>
+    </trim>
+    order by bd.id DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start}, #{count}
+      </if>
+    </trim>
+  </select>
   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDivide">
     <!--@mbg.generated-->
     insert into ba_divide (id, `name`, countyId, 
       townId, villageId, blockId, 
-      villages, area, `header`, 
+      villages, area, header,
       phone, lng, lat, remark, 
       deleted)
     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{countyId,jdbcType=BIGINT}, 

--
Gitblit v1.8.0