From fd2de42e8b0019e660f04c72d0a9d218e032f4e4 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期五, 05 七月 2024 13:59:02 +0800 Subject: [PATCH] 添加取水口和更改取水口时判断取水口是否重名 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 51 insertions(+), 2 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml index 28f8d9e..877c01d 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml @@ -15,7 +15,7 @@ </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <!--@mbg.generated--> - select + select <include refid="Base_Column_List" /> from pr_controller_tramp where id = #{id,jdbcType=BIGINT} @@ -36,7 +36,7 @@ </delete> <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrControllerTramp"> <!--@mbg.generated--> - insert into pr_controller_tramp (id, rtuAddr, protocol, + insert into pr_controller_tramp (id, rtuAddr, protocol, findDt) values (#{id,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, #{findDt,jdbcType=TIMESTAMP}) @@ -97,4 +97,53 @@ findDt = #{findDt,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> + + <!--鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨祦娴帶鍒跺櫒鍦板潃--> +<!-- <select id="getTrampRtuAddr" resultType="java.lang.String">--> +<!-- SELECT rtuAddr FROM pr_controller_tramp WHERE id = ${controllerId}--> +<!-- </select>--> + + <!--鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨祦娴帶鍒跺櫒淇℃伅--> + <select id="getTrampControllerInfo" resultMap="BaseResultMap"> + SELECT rtuAddr, protocol, findDt FROM pr_controller_tramp WHERE id = ${controllerId} + </select> + + <!-- 鏍规嵁鏉′欢鑾峰彇娴佹氮鎺у埗鍣ㄤ俊鎭�--> + <select id="getTrampControllers" resultMap="BaseResultMap"> + select CAST(id AS char)AS id, + rtuAddr, + protocol, + findDt + FROM pr_controller_tramp + <where> + <if test="id != null and id !=''"> + id = #{id,jdbcType=VARCHAR} + </if> + <if test="rtuAddr != null and rtuAddr != ''"> + AND rtuAddr = #{rtuAddr,jdbcType=VARCHAR} + </if> + <if test="protocol != null and protocol != ''"> + AND protocol = #{protocol,jdbcType=VARCHAR} + </if> + + </where> + </select> + <!-- 鏍规嵁鏉′欢鑾峰彇娴佹氮鎺у埗鍣ㄦ暟閲�--> + <select id="getTrampControllersCount" resultType="java.lang.Long"> + select + COUNT(*) AS recordCount + FROM pr_controller_tramp + <where> + <if test="id != null and id !=''"> + id = #{id,jdbcType=VARCHAR} + </if> + <if test="rtuAddr != null and rtuAddr != ''"> + AND rtuAddr = #{rtuAddr,jdbcType=VARCHAR} + </if> + <if test="protocol != null and protocol != ''"> + AND protocol = #{protocol,jdbcType=VARCHAR} + </if> + + </where> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0