From 9619e60e3075a432d692f3cd8b76787568c53aad Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 07 五月 2025 15:56:58 +0800
Subject: [PATCH] 1、完善代码;2、禁止输出SpringBoot启动时Banner。
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrProjectMapper.xml | 433 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 322 insertions(+), 111 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrProjectMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrProjectMapper.xml
index 81848e5..eb9c488 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrProjectMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrProjectMapper.xml
@@ -1,118 +1,329 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoIr.IrProjectMapper">
- <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrProject">
- <!--@mbg.generated-->
- <!--@Table ir_project-->
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="project_name" jdbcType="VARCHAR" property="projectName" />
- <result column="province_id" jdbcType="BIGINT" property="provinceId" />
- <result column="city_id" jdbcType="BIGINT" property="cityId" />
- <result column="county_id" jdbcType="BIGINT" property="countyId" />
- <result column="town_id" jdbcType="BIGINT" property="townId" />
- <result column="village_id" jdbcType="BIGINT" property="villageId" />
- <result column="project_state" jdbcType="TINYINT" property="projectState" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="operator" jdbcType="BIGINT" property="operator" />
- <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" />
- <result column="deleted" jdbcType="TINYINT" property="deleted" />
- </resultMap>
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrProject">
+ <!--@mbg.generated-->
+ <!--@Table ir_project-->
+ <id column="id" jdbcType="BIGINT" property="id" />
+ <result column="project_name" jdbcType="VARCHAR" property="projectName" />
+ <result column="province_id" jdbcType="BIGINT" property="provinceId" />
+ <result column="city_id" jdbcType="BIGINT" property="cityId" />
+ <result column="county_id" jdbcType="BIGINT" property="countyId" />
+ <result column="town_id" jdbcType="BIGINT" property="townId" />
+ <result column="village_id" jdbcType="BIGINT" property="villageId" />
+ <result column="project_state" jdbcType="TINYINT" property="projectState" />
+ <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+ <result column="operator" jdbcType="BIGINT" property="operator" />
+ <result column="operate_time" jdbcType="TIMESTAMP" property="operateTime" />
+ <result column="deleted" jdbcType="TINYINT" property="deleted" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
+ id, project_name, province_id, city_id, county_id, town_id, village_id, project_state,
+ remarks, `operator`, operate_time, deleted
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from ir_project
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete from ir_project
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
+ <!--@mbg.generated-->
+ insert into ir_project (id, project_name, province_id,
+ city_id, county_id, town_id,
+ village_id, project_state, remarks,
+ `operator`, operate_time, deleted
+ )
+ values (#{id,jdbcType=BIGINT}, #{projectName,jdbcType=VARCHAR}, #{provinceId,jdbcType=BIGINT},
+ #{cityId,jdbcType=BIGINT}, #{countyId,jdbcType=BIGINT}, #{townId,jdbcType=BIGINT},
+ #{villageId,jdbcType=BIGINT}, #{projectState,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR},
+ #{operator,jdbcType=BIGINT}, #{operateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=TINYINT}
+ )
+ </insert>
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
+ <!--@mbg.generated-->
+ insert into ir_project
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="projectName != null">
+ project_name,
+ </if>
+ <if test="provinceId != null">
+ province_id,
+ </if>
+ <if test="cityId != null">
+ city_id,
+ </if>
+ <if test="countyId != null">
+ county_id,
+ </if>
+ <if test="townId != null">
+ town_id,
+ </if>
+ <if test="villageId != null">
+ village_id,
+ </if>
+ <if test="projectState != null">
+ project_state,
+ </if>
+ <if test="remarks != null">
+ remarks,
+ </if>
+ <if test="operator != null">
+ `operator`,
+ </if>
+ <if test="operateTime != null">
+ operate_time,
+ </if>
+ <if test="deleted != null">
+ deleted,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="projectName != null">
+ #{projectName,jdbcType=VARCHAR},
+ </if>
+ <if test="provinceId != null">
+ #{provinceId,jdbcType=BIGINT},
+ </if>
+ <if test="cityId != null">
+ #{cityId,jdbcType=BIGINT},
+ </if>
+ <if test="countyId != null">
+ #{countyId,jdbcType=BIGINT},
+ </if>
+ <if test="townId != null">
+ #{townId,jdbcType=BIGINT},
+ </if>
+ <if test="villageId != null">
+ #{villageId,jdbcType=BIGINT},
+ </if>
+ <if test="projectState != null">
+ #{projectState,jdbcType=TINYINT},
+ </if>
+ <if test="remarks != null">
+ #{remarks,jdbcType=VARCHAR},
+ </if>
+ <if test="operator != null">
+ #{operator,jdbcType=BIGINT},
+ </if>
+ <if test="operateTime != null">
+ #{operateTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="deleted != null">
+ #{deleted,jdbcType=TINYINT},
+ </if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
+ <!--@mbg.generated-->
+ update ir_project
+ <set>
+ <if test="projectName != null">
+ project_name = #{projectName,jdbcType=VARCHAR},
+ </if>
+ <if test="provinceId != null">
+ province_id = #{provinceId,jdbcType=BIGINT},
+ </if>
+ <if test="cityId != null">
+ city_id = #{cityId,jdbcType=BIGINT},
+ </if>
+ <if test="countyId != null">
+ county_id = #{countyId,jdbcType=BIGINT},
+ </if>
+ <if test="townId != null">
+ town_id = #{townId,jdbcType=BIGINT},
+ </if>
+ <if test="villageId != null">
+ village_id = #{villageId,jdbcType=BIGINT},
+ </if>
+ <if test="projectState != null">
+ project_state = #{projectState,jdbcType=TINYINT},
+ </if>
+ <if test="remarks != null">
+ remarks = #{remarks,jdbcType=VARCHAR},
+ </if>
+ <if test="operator != null">
+ `operator` = #{operator,jdbcType=BIGINT},
+ </if>
+ <if test="operateTime != null">
+ operate_time = #{operateTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="deleted != null">
+ deleted = #{deleted,jdbcType=TINYINT},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
+ <!--@mbg.generated-->
+ update ir_project
+ set project_name = #{projectName,jdbcType=VARCHAR},
+ province_id = #{provinceId,jdbcType=BIGINT},
+ city_id = #{cityId,jdbcType=BIGINT},
+ county_id = #{countyId,jdbcType=BIGINT},
+ town_id = #{townId,jdbcType=BIGINT},
+ village_id = #{villageId,jdbcType=BIGINT},
+ project_state = #{projectState,jdbcType=TINYINT},
+ remarks = #{remarks,jdbcType=VARCHAR},
+ `operator` = #{operator,jdbcType=BIGINT},
+ operate_time = #{operateTime,jdbcType=TIMESTAMP},
+ deleted = #{deleted,jdbcType=TINYINT}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
- <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
- <!--@mbg.generated-->
- insert into ir_project
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="projectName != null">
- project_name,
- </if>
- <if test="provinceId != null">
- province_id,
- </if>
- <if test="cityId != null">
- city_id,
- </if>
- <if test="countyId != null">
- county_id,
- </if>
- <if test="townId != null">
- town_id,
- </if>
- <if test="villageId != null">
- village_id,
- </if>
- <if test="projectState != null">
- project_state,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="operator != null">
- `operator`,
- </if>
- <if test="operateDt != null">
- operate_time,
- </if>
- <if test="deleted != null">
- deleted,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="projectName != null">
- #{projectName,jdbcType=VARCHAR},
- </if>
- <if test="provinceId != null">
- #{provinceId,jdbcType=BIGINT},
- </if>
- <if test="cityId != null">
- #{cityId,jdbcType=BIGINT},
- </if>
- <if test="countyId != null">
- #{countyId,jdbcType=BIGINT},
- </if>
- <if test="townId != null">
- #{townId,jdbcType=BIGINT},
- </if>
- <if test="villageId != null">
- #{villageId,jdbcType=BIGINT},
- </if>
- <if test="projectState != null">
- #{projectState,jdbcType=TINYINT},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="operator != null">
- #{operator,jdbcType=BIGINT},
- </if>
- <if test="operateDt != null">
- #{operateDt,jdbcType=TIMESTAMP},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=TINYINT},
- </if>
- </trim>
- </insert>
+ <!--鏍规嵁涓嬬骇鑾峰彇涓婁竴绾у湴鍧�-->
+ <select id="getSupperByVillageId" parameterType="_long" resultType="java.lang.Long">
+ select dis_tow.*
+ from ba_district dis_vil
+ inner join
+ ba_district dis_tow
+ on dis_vil.supperId = dis_tow.id
+ where dis_vil.id = #{vaId,jdbcType=BIGINT}
+ </select>
+ <!--閫昏緫鍒犻櫎-->
+ <delete id="deleteLogicById" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ update ir_project
+ set deleted = 1
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
- <!--鏍规嵁涓嬬骇鑾峰彇涓婁竴绾у湴鍧�-->
- <select id="getSupperByVillageId" parameterType="_long" resultType="java.lang.Long">
- select dis_tow.*
- from ba_district dis_vil
- inner join
- ba_district dis_tow
- on dis_vil.supperId = dis_tow.id
- where dis_vil.id = #{vaId,jdbcType=BIGINT}
- </select>
+ <!--淇敼鐘舵��-->
+ <update id="updateProjectState">
+ update ir_project
+ set project_state = #{projectState,jdbcType=TINYINT},
+ operator = #{operator,jdbcType=BIGINT},
+ operate_time = #{operateTime,jdbcType=TIMESTAMP}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
- <delete id="deleteLogicById" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- update ir_project
- set deleted = 1
- where id = #{id,jdbcType=BIGINT}
- </delete>
+ <!--鏌ヨ涓�涓俊鎭�-->
+ <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoProjectOne">
+ select
+ CAST(pro.id AS char)AS id,
+ CAST(pro.province_id AS char)AS provinceId,
+ CAST(pro.city_id AS char)AS cityId,
+ CAST(pro.county_id AS char)AS countyId,
+ CAST(pro.town_id AS char)AS townId,
+ CAST(pro.village_id AS char)AS villageId,
+ pro.project_name AS projectName,
+ pro.project_state AS projectState,
+ cli.name AS operatorName,
+ pro.remarks,
+ pro.operate_time AS operateDt
+ from ir_project pro
+ left join se_client cli on cli.id = pro.operator
+ where pro.id = #{id,jdbcType=BIGINT} and pro.deleted = 0
+ </select>
+
+ <!--鍒嗛〉鏌ヨ鏁伴噺-->
+ <select id="getRecordCount" resultType="java.lang.Long">
+ SELECT COUNT(*) AS recordCount
+ FROM ir_project pro
+ <where>
+ pro.deleted = 0
+ <if test="projectName != null and projectName != ''">
+ AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
+ </if>
+ <if test = "projectState != null and projectState != ''">
+ AND pro.project_state = #{projectState}
+ </if>
+ </where>
+ </select>
+
+ <!--鍒嗛〉鏌ヨ鏁版嵁-->
+ <select id="getProjects" resultType="com.dy.pipIrrGlobal.voIr.VoProject">
+ SELECT
+ CAST(pro.id AS char)AS projectId,
+ pro.project_name AS projectName,
+ pro.project_state AS projectState,
+ CONCAT(province.`name`,city.`name`,country.`name`, town.`name`, village.`name`) AS address,
+ pro.remarks,
+ pro.operate_time AS operateDt
+ FROM ir_project pro
+ LEFT JOIN ba_district province ON pro.province_id = province.id
+ LEFT JOIN ba_district city ON pro.city_id = city.id
+ LEFT JOIN ba_district country ON pro.county_id = country.id
+ LEFT JOIN ba_district town ON pro.town_id = town.id
+ LEFT JOIN ba_district village ON pro.village_id = village.id
+ <where>
+ pro.deleted = 0
+ <if test="projectName != null and projectName != ''">
+ AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
+ </if>
+ <if test = "projectState != null and projectState != ''">
+ AND pro.project_state = #{projectState}
+ </if>
+ </where>
+ ORDER BY pro.operate_time DESC
+ <if test="pageCurr != null and pageSize != null">
+ LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
+ </if>
+ </select>
+
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇椤圭洰璁板綍(绮剧畝)鏁伴噺-->
+ <select id="getSimpleProjectsCount" resultType="java.lang.Long">
+ SELECT COUNT(*) AS recordCount
+ FROM ir_project pr
+ <where>
+ AND pr.project_state = 1
+ AND pr.deleted = 0
+ <if test="projectName != null and projectName != ''">
+ AND pr.project_name LIKE CONCAT('%', #{projectName}, '%')
+ </if>
+ </where>
+ </select>
+
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇椤圭洰璁板綍(绮剧畝)-->
+ <select id="getSimpleProjects" resultType="com.dy.pipIrrGlobal.voIr.VoProjectSimple">
+ SELECT
+ pr.id AS projectId,
+ pr.project_name AS projectName,
+ (SELECT COUNT(*) FROM ir_project_group pg WHERE pg.project_id = pr.id) AS groupCount
+ FROM ir_project pr
+ <where>
+ AND pr.project_state = 1
+ AND pr.deleted = 0
+ <if test="projectName != null and projectName != ''">
+ AND pr.project_name LIKE CONCAT('%', #{projectName}, '%')
+ </if>
+ </where>
+ ORDER BY pr.operate_time DESC
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+
+ <!--鏍规嵁椤圭洰Id鑾峰彇椤圭洰璇︽儏锛岀紪杈戦」鐩俊鎭娇鐢�-->
+ <select id="getProjectDetail" resultType="com.dy.pipIrrGlobal.voIr.VoProjectDetail">
+ SELECT
+ projectName,
+ GROUP_CONCAT(groupId) AS irrigateGroups
+ FROM
+ (
+ SELECT
+ pro.project_name AS projectName,
+ grp.id AS groupId
+ FROM ir_project pro
+ INNER JOIN ir_project_group pg ON pg.project_id = pro.id
+ INNER JOIN ir_irrigate_group grp ON grp.id = pg.group_id
+ WHERE pro.deleted = 0 AND pro.id = #{projectId}
+ ) project
+ GROUP BY projectName
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0