From d89b455edc2272b2141248076dce3b660f3d20b1 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 15 八月 2025 14:33:56 +0800
Subject: [PATCH] 完善代码

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdCropsMapper.xml |   87 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 77 insertions(+), 10 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdCropsMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdCropsMapper.xml
index 20d6f6d..b738134 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdCropsMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdCropsMapper.xml
@@ -6,8 +6,8 @@
     <!--@Table md_crops-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="start_dt" jdbcType="DATE" property="startDt" />
-    <result column="end_dt" jdbcType="DATE" property="endDt" />
+    <result column="start_dt" jdbcType="VARCHAR" property="startDt" />
+    <result column="end_dt" jdbcType="VARCHAR" property="endDt" />
     <result column="stopped" jdbcType="TINYINT" property="stopped" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
     <result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
@@ -17,6 +17,10 @@
     <!--@mbg.generated-->
     id, `name`, start_dt, end_dt, stopped, remarks, create_dt, deleted
   </sql>
+  <sql id="Part_Column_List">
+    <!--@mbg.generated-->
+    id, `name`, start_dt, end_dt, stopped, remarks, create_dt
+  </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     select 
@@ -24,6 +28,15 @@
     from md_crops
     where id = #{id,jdbcType=BIGINT}
   </select>
+
+  <select id="selectById" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voMd.VoCrops">
+    <!--@mbg.generated-->
+    select
+    <include refid="Base_Column_List" />
+    from md_crops
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     delete from md_crops
@@ -34,8 +47,8 @@
     insert into md_crops (id, `name`, start_dt, 
       end_dt, stopped, remarks, 
       create_dt, deleted)
-    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{startDt,jdbcType=DATE}, 
-      #{endDt,jdbcType=DATE}, #{stopped,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{startDt,jdbcType=VARCHAR},
+      #{endDt,jdbcType=VARCHAR}, #{stopped,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR},
       #{createDt,jdbcType=TIMESTAMP}, #{deleted,jdbcType=TINYINT})
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoMd.MdCrops">
@@ -75,10 +88,10 @@
         #{name,jdbcType=VARCHAR},
       </if>
       <if test="startDt != null">
-        #{startDt,jdbcType=DATE},
+        #{startDt,jdbcType=VARCHAR},
       </if>
       <if test="endDt != null">
-        #{endDt,jdbcType=DATE},
+        #{endDt,jdbcType=VARCHAR},
       </if>
       <if test="stopped != null">
         #{stopped,jdbcType=TINYINT},
@@ -102,10 +115,10 @@
         `name` = #{name,jdbcType=VARCHAR},
       </if>
       <if test="startDt != null">
-        start_dt = #{startDt,jdbcType=DATE},
+        start_dt = #{startDt,jdbcType=VARCHAR},
       </if>
       <if test="endDt != null">
-        end_dt = #{endDt,jdbcType=DATE},
+        end_dt = #{endDt,jdbcType=VARCHAR},
       </if>
       <if test="stopped != null">
         stopped = #{stopped,jdbcType=TINYINT},
@@ -126,12 +139,66 @@
     <!--@mbg.generated-->
     update md_crops
     set `name` = #{name,jdbcType=VARCHAR},
-      start_dt = #{startDt,jdbcType=DATE},
-      end_dt = #{endDt,jdbcType=DATE},
+      start_dt = #{startDt,jdbcType=VARCHAR},
+      end_dt = #{endDt,jdbcType=VARCHAR},
       stopped = #{stopped,jdbcType=TINYINT},
       remarks = #{remarks,jdbcType=VARCHAR},
       create_dt = #{createDt,jdbcType=TIMESTAMP},
       deleted = #{deleted,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectById" parameterType="java.lang.Long" resultType="com.dy.pipIrrGlobal.voMd.VoCrops">
+    <!--@mbg.generated-->
+    select
+    <include refid="Part_Column_List" />
+    from md_crops
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+
+  <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long">
+    select
+    count(*)
+    from md_crops tb
+    where tb.deleted != 1
+    <trim prefix="and" suffixOverrides="and">
+      <if test="name != null and name != ''">
+        tb.name like concat('%', #{name}, '%') and
+      </if>
+    </trim>
+  </select>
+  <select id="selectSome" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voMd.VoCrops">
+    select
+    <include refid="Part_Column_List" />
+    from md_crops tb
+    where tb.deleted != 1
+    <trim prefix="and" suffixOverrides="and">
+      <if test="name != null and name != ''">
+        tb.name like concat('%', #{name}, '%') and
+      </if>
+    </trim>
+    order by tb.id DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <select id="selectAll" resultType="com.dy.pipIrrGlobal.voMd.VoCrops">
+    select
+    <include refid="Part_Column_List" >
+      <property name="alias" value="tb"/>
+    </include>
+    from md_crops tb
+    where tb.deleted != 1
+    order by tb.id ASC
+  </select>
+
+  <update id="deleteById" parameterType="java.lang.Long">
+    update md_crops
+    set deleted = 1
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0