From e021502051079ac2b2c2adcea60b9ec01556b7fe Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 02 九月 2024 11:34:41 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoUnclosedValve.java | 4 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/CloseTypeQo.java | 4 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java | 13 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java | 13 pipIrr-platform/pipIrr-global/src/main/resources/application-database-pj.yml | 4 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java | 14 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java | 27 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java | 85 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoMapCenter.java | 31 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml | 1219 +++++++++++++------------ pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java | 157 +++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java | 3 pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml | 50 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java | 18 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml | 92 -- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/AreaCode2023.java | 52 + pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java | 22 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java | 29 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml | 630 +++++++------ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java | 16 /dev/null | 12 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/AreaCode2023Mapper.java | 38 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDistrict.java | 30 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java | 1 pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/LoginVo.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/qo/DistrictQO.java | 21 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml | 4 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java | 22 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java | 4 pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml | 1 pipIrr-platform/pipIrr-global/src/main/resources/mapper/AreaCode2023Mapper.xml | 115 ++ 32 files changed, 1,655 insertions(+), 1,080 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/AreaCode2023Mapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/AreaCode2023Mapper.java new file mode 100644 index 0000000..7b03bdf --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/AreaCode2023Mapper.java @@ -0,0 +1,38 @@ +package com.dy.pipIrrGlobal.daoBa; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoBa.AreaCode2023; +import com.dy.pipIrrGlobal.voBa.VoDistrict; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author ZhuBaoMin + * @date 2024-08-30 16:09 + * @LastEditTime 2024-08-30 16:09 + * @Description + */ +@Mapper +public interface AreaCode2023Mapper extends BaseMapper<AreaCode2023> { + int deleteByPrimaryKey(Long code); + + int insert(AreaCode2023 record); + + int insertSelective(AreaCode2023 record); + + AreaCode2023 selectByPrimaryKey(Long code); + + int updateByPrimaryKeySelective(AreaCode2023 record); + + int updateByPrimaryKey(AreaCode2023 record); + + /** + * 鏍规嵁鍖哄垝浠g爜鏌ヨ鎸囧畾绾у埆琛屾斂鍖哄垝 + * @param aredCode + * @param level + * @return + */ + List<VoDistrict> getDistrictS(@Param("aredCode") String aredCode, @Param("level") Integer level); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java index 12fbdc8..f444fe3 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java @@ -3,11 +3,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoSe.SeClientCard; import com.dy.pipIrrGlobal.voSe.VoCardInfo; - import com.dy.pipIrrGlobal.voSe.VoCardInfo1; import com.dy.pipIrrGlobal.voSe.VoCards; import com.dy.pipIrrGlobal.voSe.VoCards2; -import com.dy.pipIrrGlobal.voSt.VoICCard; import com.dy.pipIrrGlobal.voWe.VoCards3; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -190,4 +188,18 @@ * @return */ Double getTotalMoneyIcCards(); + + /** + * 鏍规嵁姘村崱鍦板潃鑾峰彇姘村崱鏁伴噺锛岀敤鏉ュ垽鏂鍗℃槸鍚﹀厑璁稿紑鍗� + * @param cardAddr + * @return + */ + Long getCountByCardAddr(String cardAddr); + + /** + * 鏍规嵁姘村崱鍦板潃鑾峰彇鎸囧畾鐘舵�佺殑姘村崱鏁伴噺锛岀敤鏉ュ垽鏂鍗℃槸鍚﹀厑璁稿紑鍗� + * @param cardAddr + * @return + */ + Long getCountByCardAddrAndState(String cardAddr); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/AreaCode2023.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/AreaCode2023.java new file mode 100644 index 0000000..17e6a4d --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/AreaCode2023.java @@ -0,0 +1,52 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import lombok.*; + +/** + * @author ZhuBaoMin + * @date 2024-08-30 16:09 + * @LastEditTime 2024-08-30 16:09 + * @Description + */ + +@TableName(value="area_code_2023", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +public class AreaCode2023 implements BaseEntity { + public static final long serialVersionUID = 202408301613001L; + + /** + * 鍖哄垝浠g爜 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private Long code; + + /** + * 鍚嶇О + */ + private String name; + + /** + * 绾у埆1-5,鐪佸競鍘块晣鏉� + */ + private Boolean level; + + /** + * 鐖剁骇鍖哄垝浠g爜 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private Long pcode; + + /** + * 鍩庝埂鍒嗙被 + */ + private Integer category; + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDistrict.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDistrict.java new file mode 100644 index 0000000..1aecf28 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoDistrict.java @@ -0,0 +1,30 @@ +package com.dy.pipIrrGlobal.voBa; + +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-08-30 16:02 + * @LastEditTime 2024-08-30 16:02 + * @Description 鍖哄垝瑙嗗浘瀵硅薄 + */ + +@Data +public class VoDistrict { + private static final long serialVersionUID = 202408301604001L; + + /** + * 鍖哄垝鍚嶇О + */ + private String name; + + /** + * 鍖哄垝浠g爜 + */ + private String code; + + /** + * 绾у埆锛�1-5鐪佸競鍘块晣鏉� + */ + private Integer level; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoMapCenter.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoMapCenter.java new file mode 100644 index 0000000..24e2e9f --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoMapCenter.java @@ -0,0 +1,31 @@ +package com.dy.pipIrrGlobal.voBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author ZhuBaoMin + * @date 2024-08-29 17:27 + * @LastEditTime 2024-08-29 17:27 + * @Description + */ + +@Data +public class VoMapCenter { + private static final long serialVersionUID = 202408291727001L; + + /** + * 绾害 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private BigDecimal lat; + + /** + * 缁忓害 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private BigDecimal lng; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoUnclosedValve.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoUnclosedValve.java index da4c9c2..e09b215 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoUnclosedValve.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoUnclosedValve.java @@ -22,9 +22,11 @@ private String rtuAddr; + private String vcNum; + private String orderNo; - private String vcNum; + private String state; //private Date openTime; } diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java index 509eb17..9358752 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java @@ -1,5 +1,7 @@ package com.dy.pipIrrGlobal.voSe; +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; import com.dy.common.po.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -17,6 +19,7 @@ private static final long serialVersionUID = 1L; @Schema(title = "姘村崱缂栧彿") + @JSONField(serializeUsing= ObjectWriterImplToString.class) private Long cardNum; @Schema(title = "鍗$墖绫诲瀷") diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-pj.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-pj.yml index 6b1b3b1..4b385ce 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-pj.yml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-pj.yml @@ -5,8 +5,8 @@ #name: pj type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - #url: jdbc:mysql://192.168.40.166:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull - #url: jdbc:mysql://8.130.130.233:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull +# url: jdbc:mysql://192.168.40.166:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull +# url: jdbc:mysql://8.130.130.233:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull #url: jdbc:mysql://8.140.179.55:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://127.0.0.1:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull username: root diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml index 87a63f2..ed9eb26 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml @@ -7,7 +7,6 @@ driverClassName: com.mysql.cj.jdbc.Driver # url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull # url: jdbc:mysql://8.130.130.233:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull - #url: jdbc:mysql://8.140.179.55:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull username: root password: dysql,;.abc!@# diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml index 427a63b..b28eb79 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml @@ -10,6 +10,14 @@ </city> </province> </districts> + <dictionaries> + <dict code="protocol" title="鍗忚" valueType="2"> + <dictItem> + <item1 dictCode="protocol" value="p206V1_0_1" name="鑰佸崗璁�" status="1" sort="0" /> + <item2 dictCode="protocol" value="p206V202404" name="鏂板崗璁�" status="0" sort="1" /> + </dictItem> + </dict> + </dictionaries> <user name="瓒呯骇绠$悊鍛�" phone="admin" password="admin" supperAdmin="1" /> <payments> <item1 name="鐜伴噾"/> @@ -28,15 +36,16 @@ <item4 typeName="鍏绘畺鐢ㄦ按"/> <item5 typeName="缁垮寲鐢ㄦ按"/> </waterTypes> + <waterPrice price="0.90" /> <irrigateProfile> - <item1 default_value = "10" unit = "2" sort = "1" type = "1"/> - <item2 default_value = "20" unit = "2" sort = "2" type = "1" /> - <item3 default_value = "1" unit = "1" sort = "3" type = "1"/> - <item4 default_value = "2" unit = "1" sort = "4" type = "1"/> - <item5 default_value = "20" unit = "3" sort = "1" type = "2"/> - <item6 default_value = "30" unit = "3" sort = "2" type = "2"/> - <item7 default_value = "50" unit = "3" sort = "3" type = "2"/> - <item8 default_value = "80" unit = "3" sort = "4" type = "2"/> + <item1 defaultValue = "10" unit = "2" sort = "1" type = "1"/> + <item2 defaultValue = "20" unit = "2" sort = "2" type = "1" /> + <item3 defaultValue = "1" unit = "1" sort = "3" type = "1"/> + <item4 defaultValue = "2" unit = "1" sort = "4" type = "1"/> + <item5 defaultValue = "20" unit = "3" sort = "1" type = "2"/> + <item6 defaultValue = "30" unit = "3" sort = "2" type = "2"/> + <item7 defaultValue = "50" unit = "3" sort = "3" type = "2"/> + <item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/> </irrigateProfile> </org1> <org2 tag="pj" name="鐗囪" enable="false"> @@ -47,6 +56,14 @@ </city> </province> </districts> + <dictionaries> + <dict code="protocol" title="鍗忚" valueType="2"> + <dictItem> + <item1 dictCode="protocol" value="p206V1_0_1" name="鑰佸崗璁�" status="1" sort="0" /> + <item2 dictCode="protocol" value="p206V202404" name="鏂板崗璁�" status="0" sort="1" /> + </dictItem> + </dict> + </dictionaries> <user name="瓒呯骇绠$悊鍛�" phone="admin" password="admin" supperAdmin="1" /> <payments> <item1 name="鐜伴噾"/> @@ -65,15 +82,16 @@ <item4 typeName="鍏绘畺鐢ㄦ按"/> <item5 typeName="缁垮寲鐢ㄦ按"/> </waterTypes> + <waterPrice price="0.90" /> <irrigateProfile> - <item1 default_value = "10" unit = "2" sort = "1" type = "1"/> - <item2 default_value = "20" unit = "2" sort = "2" type = "1" /> - <item3 default_value = "1" unit = "1" sort = "3" type = "1"/> - <item4 default_value = "2" unit = "1" sort = "4" type = "1"/> - <item5 default_value = "20" unit = "3" sort = "1" type = "2"/> - <item6 default_value = "30" unit = "3" sort = "2" type = "2"/> - <item7 default_value = "50" unit = "3" sort = "3" type = "2"/> - <item8 default_value = "80" unit = "3" sort = "4" type = "2"/> + <item1 defaultValue = "10" unit = "2" sort = "1" type = "1"/> + <item2 defaultValue = "20" unit = "2" sort = "2" type = "1" /> + <item3 defaultValue = "1" unit = "1" sort = "3" type = "1"/> + <item4 defaultValue = "2" unit = "1" sort = "4" type = "1"/> + <item5 defaultValue = "20" unit = "3" sort = "1" type = "2"/> + <item6 defaultValue = "30" unit = "3" sort = "2" type = "2"/> + <item7 defaultValue = "50" unit = "3" sort = "3" type = "2"/> + <item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/> </irrigateProfile> </org2> </orgs> diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/AreaCode2023Mapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/AreaCode2023Mapper.xml new file mode 100644 index 0000000..e482c61 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/AreaCode2023Mapper.xml @@ -0,0 +1,115 @@ +<?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.daoBa.AreaCode2023Mapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.AreaCode2023"> + <!--@mbg.generated--> + <!--@Table area_code_2023--> + <id column="code" jdbcType="BIGINT" property="code" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="level" jdbcType="BOOLEAN" property="level" /> + <result column="pcode" jdbcType="BIGINT" property="pcode" /> + <result column="category" jdbcType="INTEGER" property="category" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + code, `name`, `level`, pcode, category + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from area_code_2023 + where code = #{code,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from area_code_2023 + where code = #{code,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.AreaCode2023"> + <!--@mbg.generated--> + insert into area_code_2023 (code, `name`, `level`, + pcode, category) + values (#{code,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=BOOLEAN}, + #{pcode,jdbcType=BIGINT}, #{category,jdbcType=INTEGER}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.AreaCode2023"> + <!--@mbg.generated--> + insert into area_code_2023 + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="code != null"> + code, + </if> + <if test="name != null"> + `name`, + </if> + <if test="level != null"> + `level`, + </if> + <if test="pcode != null"> + pcode, + </if> + <if test="category != null"> + category, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="code != null"> + #{code,jdbcType=BIGINT}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="level != null"> + #{level,jdbcType=BOOLEAN}, + </if> + <if test="pcode != null"> + #{pcode,jdbcType=BIGINT}, + </if> + <if test="category != null"> + #{category,jdbcType=INTEGER}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.AreaCode2023"> + <!--@mbg.generated--> + update area_code_2023 + <set> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="level != null"> + `level` = #{level,jdbcType=BOOLEAN}, + </if> + <if test="pcode != null"> + pcode = #{pcode,jdbcType=BIGINT}, + </if> + <if test="category != null"> + category = #{category,jdbcType=INTEGER}, + </if> + </set> + where code = #{code,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.AreaCode2023"> + <!--@mbg.generated--> + update area_code_2023 + set `name` = #{name,jdbcType=VARCHAR}, + `level` = #{level,jdbcType=BOOLEAN}, + pcode = #{pcode,jdbcType=BIGINT}, + category = #{category,jdbcType=INTEGER} + where code = #{code,jdbcType=BIGINT} + </update> + + <!--鏍规嵁鍖哄垝浠g爜鏌ヨ鎸囧畾绾у埆琛屾斂鍖哄垝--> + <select id="getDistrictS" resultType="com.dy.pipIrrGlobal.voBa.VoDistrict"> + SELECT + name, + CASE + WHEN level = 4 THEN SUBSTRING(code,7,3) + WHEN level = 5 THEN SUBSTRING(code,10,3) + END AS code, + level + FROM area_code_2023 + WHERE code LIKE CONCAT('%', #{aredCode}, '%') AND level = #{level} + </select> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml index 0f4282c..7888144 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml @@ -1,315 +1,359 @@ <?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.daoRm.RmCommandHistoryMapper"> - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> - <!--@mbg.generated--> - <!--@Table rm_command_history--> - <id column="com_id" jdbcType="BIGINT" property="comId" /> - <result column="command_code" jdbcType="VARCHAR" property="commandCode" /> - <result column="command_name" jdbcType="VARCHAR" property="commandName" /> - <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> - <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> - <result column="protocol" jdbcType="VARCHAR" property="protocol" /> - <result column="param" property="param" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" /> - <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" /> - <result column="operator" jdbcType="BIGINT" property="operator" /> - <result column="result" jdbcType="TINYINT" property="result" /> - <result column="result_time" jdbcType="TIMESTAMP" property="resultTime" /> - <result column="result_text" jdbcType="LONGVARCHAR" property="resultText" /> - </resultMap> - <sql id="Base_Column_List"> - <!--@mbg.generated--> - com_id, command_code, command_name, intake_id, rtu_addr, protocol, param, send_time, - `operator`, `result`, result_time, result_text - </sql> - <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> - <!--@mbg.generated--> - select - <include refid="Base_Column_List" /> - from rm_command_history - where com_id = #{comId,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> - <!--@mbg.generated--> - delete from rm_command_history - where com_id = #{comId,jdbcType=BIGINT} - </delete> - <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> - <!--@mbg.generated--> - insert into rm_command_history (com_id, command_code, command_name, - intake_id, rtu_addr, protocol, - param, send_time, `operator`, - `result`, result_time, result_text - ) - values (#{comId,jdbcType=BIGINT}, #{commandCode,jdbcType=VARCHAR}, #{commandName,jdbcType=VARCHAR}, - #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, - #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{sendTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT}, - #{result,jdbcType=TINYINT}, #{resultTime,jdbcType=TIMESTAMP}, #{resultText,jdbcType=LONGVARCHAR} - ) - </insert> - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> - <!--@mbg.generated--> - insert into rm_command_history - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="comId != null"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> + <!--@mbg.generated--> + <!--@Table rm_command_history--> + <id column="com_id" jdbcType="BIGINT" property="comId"/> + <result column="command_code" jdbcType="VARCHAR" property="commandCode"/> + <result column="command_name" jdbcType="VARCHAR" property="commandName"/> + <result column="intake_id" jdbcType="BIGINT" property="intakeId"/> + <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr"/> + <result column="protocol" jdbcType="VARCHAR" property="protocol"/> + <result column="param" property="param" jdbcType="JAVA_OBJECT" + typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/> + <result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/> + <result column="operator" jdbcType="BIGINT" property="operator"/> + <result column="result" jdbcType="TINYINT" property="result"/> + <result column="result_time" jdbcType="TIMESTAMP" property="resultTime"/> + <result column="result_text" jdbcType="LONGVARCHAR" property="resultText"/> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> com_id, - </if> - <if test="commandCode != null"> command_code, - </if> - <if test="commandName != null"> command_name, - </if> - <if test="intakeId != null"> intake_id, - </if> - <if test="rtuAddr != null"> rtu_addr, - </if> - <if test="protocol != null"> protocol, - </if> - <if test="param != null"> param, - </if> - <if test="sendTime != null"> send_time, - </if> - <if test="operator != null"> `operator`, - </if> - <if test="result != null"> `result`, - </if> - <if test="resultTime != null"> result_time, - </if> - <if test="resultText != null"> - result_text, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="comId != null"> - #{comId,jdbcType=BIGINT}, - </if> - <if test="commandCode != null"> - #{commandCode,jdbcType=VARCHAR}, - </if> - <if test="commandName != null"> - #{commandName,jdbcType=VARCHAR}, - </if> - <if test="intakeId != null"> - #{intakeId,jdbcType=BIGINT}, - </if> - <if test="rtuAddr != null"> - #{rtuAddr,jdbcType=VARCHAR}, - </if> - <if test="protocol != null"> - #{protocol,jdbcType=VARCHAR}, - </if> - <if test="param != null"> - #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, - </if> - <if test="sendTime != null"> - #{sendTime,jdbcType=TIMESTAMP}, - </if> - <if test="operator != null"> - #{operator,jdbcType=BIGINT}, - </if> - <if test="result != null"> - #{result,jdbcType=TINYINT}, - </if> - <if test="resultTime != null"> - #{resultTime,jdbcType=TIMESTAMP}, - </if> - <if test="resultText != null"> - #{resultText,jdbcType=LONGVARCHAR}, - </if> - </trim> - </insert> - <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> - <!--@mbg.generated--> - update rm_command_history - <set> - <if test="commandCode != null"> - command_code = #{commandCode,jdbcType=VARCHAR}, - </if> - <if test="commandName != null"> - command_name = #{commandName,jdbcType=VARCHAR}, - </if> - <if test="intakeId != null"> - intake_id = #{intakeId,jdbcType=BIGINT}, - </if> - <if test="rtuAddr != null"> - rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, - </if> - <if test="protocol != null"> - protocol = #{protocol,jdbcType=VARCHAR}, - </if> - <if test="param != null"> - param = #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, - </if> - <if test="sendTime != null"> - send_time = #{sendTime,jdbcType=TIMESTAMP}, - </if> - <if test="operator != null"> - `operator` = #{operator,jdbcType=BIGINT}, - </if> - <if test="result != null"> - `result` = #{result,jdbcType=TINYINT}, - </if> - <if test="resultTime != null"> - result_time = #{resultTime,jdbcType=TIMESTAMP}, - </if> - <if test="resultText != null"> - result_text = #{resultText,jdbcType=LONGVARCHAR}, - </if> - </set> - where com_id = #{comId,jdbcType=BIGINT} - </update> - <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> - <!--@mbg.generated--> - update rm_command_history - set command_code = #{commandCode,jdbcType=VARCHAR}, - command_name = #{commandName,jdbcType=VARCHAR}, - intake_id = #{intakeId,jdbcType=BIGINT}, - rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, - protocol = #{protocol,jdbcType=VARCHAR}, - param = #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, - send_time = #{sendTime,jdbcType=TIMESTAMP}, - `operator` = #{operator,jdbcType=BIGINT}, - `result` = #{result,jdbcType=TINYINT}, - result_time = #{resultTime,jdbcType=TIMESTAMP}, - result_text = #{resultText,jdbcType=LONGVARCHAR} - where com_id = #{comId,jdbcType=BIGINT} - </update> + result_text + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List"/> + from rm_command_history + where com_id = #{comId,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete + from rm_command_history + where com_id = #{comId,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> + <!--@mbg.generated--> + insert into rm_command_history (com_id, command_code, command_name, + intake_id, rtu_addr, protocol, + param, send_time, `operator`, + `result`, result_time, result_text) + values (#{comId,jdbcType=BIGINT}, #{commandCode,jdbcType=VARCHAR}, #{commandName,jdbcType=VARCHAR}, + #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, + #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, + #{sendTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT}, + #{result,jdbcType=TINYINT}, #{resultTime,jdbcType=TIMESTAMP}, #{resultText,jdbcType=LONGVARCHAR}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> + <!--@mbg.generated--> + insert into rm_command_history + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="comId != null"> + com_id, + </if> + <if test="commandCode != null"> + command_code, + </if> + <if test="commandName != null"> + command_name, + </if> + <if test="intakeId != null"> + intake_id, + </if> + <if test="rtuAddr != null"> + rtu_addr, + </if> + <if test="protocol != null"> + protocol, + </if> + <if test="param != null"> + param, + </if> + <if test="sendTime != null"> + send_time, + </if> + <if test="operator != null"> + `operator`, + </if> + <if test="result != null"> + `result`, + </if> + <if test="resultTime != null"> + result_time, + </if> + <if test="resultText != null"> + result_text, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="comId != null"> + #{comId,jdbcType=BIGINT}, + </if> + <if test="commandCode != null"> + #{commandCode,jdbcType=VARCHAR}, + </if> + <if test="commandName != null"> + #{commandName,jdbcType=VARCHAR}, + </if> + <if test="intakeId != null"> + #{intakeId,jdbcType=BIGINT}, + </if> + <if test="rtuAddr != null"> + #{rtuAddr,jdbcType=VARCHAR}, + </if> + <if test="protocol != null"> + #{protocol,jdbcType=VARCHAR}, + </if> + <if test="param != null"> + #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, + </if> + <if test="sendTime != null"> + #{sendTime,jdbcType=TIMESTAMP}, + </if> + <if test="operator != null"> + #{operator,jdbcType=BIGINT}, + </if> + <if test="result != null"> + #{result,jdbcType=TINYINT}, + </if> + <if test="resultTime != null"> + #{resultTime,jdbcType=TIMESTAMP}, + </if> + <if test="resultText != null"> + #{resultText,jdbcType=LONGVARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> + <!--@mbg.generated--> + update rm_command_history + <set> + <if test="commandCode != null"> + command_code = #{commandCode,jdbcType=VARCHAR}, + </if> + <if test="commandName != null"> + command_name = #{commandName,jdbcType=VARCHAR}, + </if> + <if test="intakeId != null"> + intake_id = #{intakeId,jdbcType=BIGINT}, + </if> + <if test="rtuAddr != null"> + rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, + </if> + <if test="protocol != null"> + protocol = #{protocol,jdbcType=VARCHAR}, + </if> + <if test="param != null"> + param = #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, + </if> + <if test="sendTime != null"> + send_time = #{sendTime,jdbcType=TIMESTAMP}, + </if> + <if test="operator != null"> + `operator` = #{operator,jdbcType=BIGINT}, + </if> + <if test="result != null"> + `result` = #{result,jdbcType=TINYINT}, + </if> + <if test="resultTime != null"> + result_time = #{resultTime,jdbcType=TIMESTAMP}, + </if> + <if test="resultText != null"> + result_text = #{resultText,jdbcType=LONGVARCHAR}, + </if> + </set> + where com_id = #{comId,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory"> + <!--@mbg.generated--> + update rm_command_history + set command_code = #{commandCode,jdbcType=VARCHAR}, + command_name = #{commandName,jdbcType=VARCHAR}, + intake_id = #{intakeId,jdbcType=BIGINT}, + rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, + protocol = #{protocol,jdbcType=VARCHAR}, + param = #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, + send_time = #{sendTime,jdbcType=TIMESTAMP}, + `operator` = #{operator,jdbcType=BIGINT}, + `result` = #{result,jdbcType=TINYINT}, + result_time = #{resultTime,jdbcType=TIMESTAMP}, + result_text = #{resultText,jdbcType=LONGVARCHAR} + where com_id = #{comId,jdbcType=BIGINT} + </update> - <!--鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍锛堝寘鍚湪绾挎儏鍐碉級--> - <select id="getUnclosedValves" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedValve"> - SELECT - inta.name AS intakeNum, - rtus.isOnLine, - com.rtu_addr AS rtuAddr, - com.param ->>'$.icCardNo' AS vcNum, - (SELECT param ->>'$.orderNo' AS orderNo FROM rm_command_history WHERE rtu_addr = com.rtu_addr ORDER BY send_time desc LIMIT 0,1) AS orderNo - FROM rm_command_history com - INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr - INNER JOIN pr_intake inta ON con.intakeId = inta.id - INNER JOIN JSON_TABLE( - <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> - #{onLineMap}, - '$[*]' COLUMNS( - rtuAddr VARCHAR(20) PATH '$.rtuAddr', - isOnLine BOOLEAN PATH '$.isOnLine' + <!--鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍锛堝寘鍚湪绾挎儏鍐碉級--> + <select id="getUnclosedValves" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedValve"> + SELECT inta.name AS intakeNum, + rtus.isOnLine, + com.rtu_addr AS rtuAddr, + com.param ->> '$.icCardNo' AS vcNum, + (SELECT param ->> '$.orderNo' AS orderNo + FROM rm_command_history + WHERE rtu_addr = com.rtu_addr + ORDER BY send_time desc + LIMIT 0,1) AS orderNo, + 'toClose' AS state + FROM rm_command_history com + INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr + INNER JOIN pr_intake inta ON con.intakeId = inta.id + INNER JOIN JSON_TABLE( + <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> + #{onLineMap}, + '$[*]' COLUMNS ( + rtuAddr VARCHAR(20) PATH '$.rtuAddr', + isOnLine BOOLEAN PATH '$.isOnLine' ) - ) rtus ON com.rtu_addr = rtus.rtuAddr - <where> - AND (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') - AND com.operator = #{operator} - AND NOT EXISTS ( - SELECT * - FROM rm_command_history - WHERE (result IS NULL OR result = 1 ) - AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') - AND param ->>'$.orderNo' = com.param ->>'$.orderNo' - ) - </where> - GROUP BY inta.name, rtus.isOnLine, com.rtu_addr, com.param ->>'$.icCardNo' - </select> + ) rtus ON com.rtu_addr = rtus.rtuAddr + <where> + AND (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') + AND com.operator = #{operator} + AND NOT EXISTS( + SELECT * + FROM rm_command_history + WHERE (result IS NULL OR result = 1) + AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') + AND param ->> '$.orderNo' = com.param ->> '$.orderNo' + ) + </where> + GROUP BY inta.name, rtus.isOnLine, com.rtu_addr, com.param ->> '$.icCardNo' - <!--鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟--> - <select id="getUncloseParam" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedParam"> - SELECT - com.rtu_addr AS rtuAddr, - com.param ->>'$.orderNo' AS orderNo, - com.param ->>'$.icCardNo' AS vcNum - FROM rm_command_history com - INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr - INNER JOIN pr_intake inta ON con.intakeId = inta.id - INNER JOIN JSON_TABLE( - <!-- '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> - #{onLineMap}, - '$[*]' COLUMNS( - rtuAddr VARCHAR(20) PATH '$.rtuAddr', - isOnLine BOOLEAN PATH '$.isOnLine' + UNION ALL + + SELECT inta.name AS intakeNum, + rtus.isOnLine, + com.rtu_addr AS rtuAddr, + com.param ->> '$.icCardNo' AS vcNum, + (SELECT param ->> '$.orderNo' AS orderNo + FROM rm_command_history + WHERE rtu_addr = com.rtu_addr + ORDER BY send_time desc + LIMIT 0,1) AS orderNo, + 'toCancel' AS state + FROM rm_command_history com + INNER JOIN pr_intake inta ON inta.id = com.intake_id + INNER JOIN JSON_TABLE( + #{onLineMap}, + '$[*]' COLUMNS ( + rtuAddr VARCHAR(20) PATH '$.rtuAddr', + isOnLine BOOLEAN PATH '$.isOnLine' + ) + ) rtus ON com.rtu_addr = rtus.rtuAddr + <where> + AND (command_code = 'A1' OR command_code = 'A2') + AND com.operator = #{operator} + AND DATE_FORMAT( + CONCAT(com.param ->> '$.year', '-', com.param ->> '$.month', '-', com.param ->> '$.day', + ' ', + com.param ->> '$.hour', ':', com.param ->> '$.minute', ':', '0'), + '%Y-%m-%d %H:%i:%S') > NOW() + </where> + </select> + + <!--鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟--> + <select id="getUncloseParam" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedParam"> + SELECT com.rtu_addr AS rtuAddr, + com.param ->> '$.orderNo' AS orderNo, + com.param ->> '$.icCardNo' AS vcNum + FROM rm_command_history com + INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr + INNER JOIN pr_intake inta ON con.intakeId = inta.id + INNER JOIN JSON_TABLE( + <!-- '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> + #{onLineMap}, + '$[*]' COLUMNS ( + rtuAddr VARCHAR(20) PATH '$.rtuAddr', + isOnLine BOOLEAN PATH '$.isOnLine' ) - ) rtus ON com.rtu_addr = rtus.rtuAddr - WHERE (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') AND con.intakeId = #{intakeId} - AND NOT EXISTS ( - SELECT * - FROM rm_command_history - WHERE (result IS NULL OR result = 1 ) - AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') - AND param ->>'$.orderNo' = com.param ->>'$.orderNo' - ) - ORDER BY com.send_time DESC - LIMIT 0,1 - </select> + ) rtus ON com.rtu_addr = rtus.rtuAddr + WHERE (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') + AND con.intakeId = #{intakeId} + AND NOT EXISTS( + SELECT * + FROM rm_command_history + WHERE (result IS NULL OR result = 1) + AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') + AND param ->> '$.orderNo' = com.param ->> '$.orderNo' + ) + ORDER BY com.send_time DESC + LIMIT 0,1 + </select> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍鎬绘暟--> - <select id="getCommandHistoriesCount" resultType="java.lang.Long"> - SELECT - COUNT(*) AS recordCount - FROM rm_command_history his - INNER JOIN pr_intake inta ON inta.id = his.intake_id - LEFT JOIN se_client cli ON cli.id = his.operator - LEFT JOIN ba_user user ON user.id = his.operator - <where> - <if test="intakeId != null"> - AND his.intake_id = #{intakeId} - </if> - <if test = "commandName != null and commandName !=''"> - AND his.command_name LIKE CONCAT('%',#{commandName},'%') - </if> - <if test = "result != null"> - AND his.result = #{result} - </if> - <if test = "timeStart != null and timeStop != null"> - AND his.send_time BETWEEN #{timeStart} AND #{timeStop} - </if> - </where> - </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍鎬绘暟--> + <select id="getCommandHistoriesCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM rm_command_history his + INNER JOIN pr_intake inta ON inta.id = his.intake_id + LEFT JOIN se_client cli ON cli.id = his.operator + LEFT JOIN ba_user user ON user.id = his.operator + <where> + <if test="intakeId != null"> + AND his.intake_id = #{intakeId} + </if> + <if test="commandName != null and commandName != ''"> + AND his.command_name LIKE CONCAT('%', #{commandName}, '%') + </if> + <if test="result != null"> + AND his.result = #{result} + </if> + <if test="timeStart != null and timeStop != null"> + AND his.send_time BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + </select> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍--> - <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand"> - SELECT - his.com_id AS comId, - his.command_name AS commandName, - inta.name AS intakeName, - his.rtu_addr AS rtuAddr, - his.protocol, - his.send_time AS sendTime, - his.result_time AS resultTime, - (CASE - WHEN his.result = 1 THEN "鎴愬姛" - ELSE "澶辫触" - END) AS result, - his.result_text, - IFNULL(cli.name, user.name) AS userName - FROM rm_command_history his - INNER JOIN pr_intake inta ON inta.id = his.intake_id - LEFT JOIN se_client cli ON cli.id = his.operator - LEFT JOIN ba_user user ON user.id = his.operator - <where> - <if test="intakeId != null"> - AND his.intake_id = #{intakeId} - </if> - <if test = "commandName != null and commandName !=''"> - AND his.command_name LIKE CONCAT('%',#{commandName},'%') - </if> - <if test = "result != null"> - AND his.result = #{result} - </if> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍--> + <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand"> + SELECT his.com_id AS comId, + his.command_name AS commandName, + inta.name AS intakeName, + his.rtu_addr AS rtuAddr, + his.protocol, + his.send_time AS sendTime, + his.result_time AS resultTime, + (CASE + WHEN his.result = 1 THEN '鎴愬姛' + ELSE '澶辫触' + END) AS result, + his.result_text, + IFNULL(cli.name, user.name) AS userName + FROM rm_command_history his + INNER JOIN pr_intake inta ON inta.id = his.intake_id + LEFT JOIN se_client cli ON cli.id = his.operator + LEFT JOIN ba_user user ON user.id = his.operator + <where> + <if test="intakeId != null"> + AND his.intake_id = #{intakeId} + </if> + <if test="commandName != null and commandName != ''"> + AND his.command_name LIKE CONCAT('%', #{commandName}, '%') + </if> + <if test="result != null"> + AND his.result = #{result} + </if> - <if test = "timeStart != null and timeStop != null"> - AND his.send_time BETWEEN #{timeStart} AND #{timeStop} - </if> - </where> - ORDER BY his.send_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> + <if test="timeStart != null and timeStop != null"> + AND his.send_time BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + ORDER BY his.send_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> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml index 5e895e4..fd60593 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml @@ -458,99 +458,7 @@ </if> </where> </select> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ュ巻鍙茶褰曟暟閲�--> - <select id="getOpenCloseValveReportsCount_history" resultType="java.lang.Long"> - SELECT COUNT(*) AS recordCount - FROM rm_open_close_valve_history oh - INNER JOIN pr_intake inta ON inta.id = oh.intake_id - <where> - <if test="intakeId != null and intakeId > 0"> - AND oh.intake_id = #{intakeId} - </if> - <if test="intakeNum != null and intakeNum != ''"> - AND inta.name LIKE CONCAT('%', #{intakeNum}, '%') - </if> - <if test="rtuAddr != null and rtuAddr != ''"> - AND oh.rtu_addr LIKE CONCAT('%', #{rtuAddr}, '%') - </if> - <if test="timeStart_open != null and timeStop_open != null"> - AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open} - </if> - <if test="timeStart_close != null and timeStop_close != null"> - AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close} - </if> - </where> - </select> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ュ巻鍙茶褰�--> - <select id="getOpenCloseValveReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoOpenCloseValve"> - SELECT oh.intake_id AS intakeId, - inta.name AS intakenum, - oh.rtu_addr AS rtuAddr, - oh.client_name AS clientName, - oh.op_ic_card_no AS openIcNum, - oh.op_ic_card_addr AS openIcAddr, - oh.op_dt AS openTime, - CASE - WHEN oh.op_type = 1 THEN '鍒峰崱寮�闃�' - WHEN oh.op_type = 3 THEN '涓績绔欏紑闃�' - WHEN oh.op_type = 5 THEN '浣欓涓嶈冻鍏抽榾' - WHEN oh.op_type = 8 THEN '鐢ㄦ埛杩滅▼寮�闃�' - WHEN oh.op_type = 11 THEN '寮�鍏抽榾鍗″紑闃�' - ELSE '鏈煡' - END AS openType, - oh.op_order_no AS openOrderNo, - oh.op_total_amount AS openTotalAmount, - oh.op_remain_money AS openRemainMoney, - oh.op_water_remain_user AS openWaterRemain, - oh.op_ele_total_amount AS openEleTotalAmount, - oh.cl_ic_card_no AS closeIcNum, - oh.cl_ic_card_addr AS closeIcAddr, - oh.cl_dt AS closeTime, - CASE - WHEN oh.cl_type = 2 THEN '鍒峰崱鍏抽榾' - WHEN oh.cl_type = 4 THEN '涓績绔欏叧闃�' - WHEN oh.cl_type = 5 THEN '浣欓涓嶈冻鍏抽榾' - WHEN oh.cl_type = 6 THEN '娴侀噺璁℃晠闅滃叧闃�' - WHEN oh.cl_type = 7 THEN '绱ф�ュ叧闃�' - WHEN oh.cl_type = 9 THEN '鐢ㄦ埛杩滅▼鍏抽榾' - WHEN oh.cl_type = 10 THEN '寮�鍏抽榾鍗″叧闃�' - WHEN oh.cl_type = 12 THEN '榛戝悕鍗曞懡浠ゅ叧闃�' - WHEN oh.cl_type = 13 THEN '杩滅▼瀹氭椂鍏抽榾' - WHEN oh.cl_type = 14 THEN '杩滅▼瀹氶噺鍏抽榾' - ELSE '鏈煡' - END AS closeType, - oh.cl_this_amount AS closeThisAmount, - oh.cl_this_time AS thisTime, - oh.cl_this_money AS thisMoney, - oh.cl_remain_money AS closeRemainMoney, - oh.cl_total_amount AS closeTotalAmount - FROM rm_open_close_valve_history oh - INNER JOIN pr_intake inta ON inta.id = oh.intake_id - <where> - <if test="intakeId != null and intakeId > 0"> - AND oh.intake_id = #{intakeId} - </if> - <if test="intakeNum != null and intakeNum != ''"> - AND inta.name LIKE CONCAT('%', #{intakeNum}, '%') - </if> - <if test="rtuAddr != null and rtuAddr != ''"> - AND oh.rtu_addr LIKE CONCAT('%', #{rtuAddr}, '%') - </if> - <if test="timeStart_open != null and timeStop_open != null"> - AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open} - </if> - <if test="timeStart_close != null and timeStop_close != null"> - AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close} - </if> - </where> - ORDER BY oh.op_dt 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="getOpenCloseValveReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoOpenCloseValve"> SELECT oh.intake_id AS intakeId, diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml index 0f5291c..e929674 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml @@ -637,7 +637,9 @@ SELECT COUNT(*) AS recordCount FROM rm_open_close_valve_history <where> - AND cl_type = #{closeType} + <if test="closeType != null"> + AND cl_type = #{closeType} + </if> <if test="timeStart != null and timeStop != null"> AND cl_dt BETWEEN #{timeStart} AND #{timeStop} </if> diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml index bd1b81a..5f2f303 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml @@ -1,618 +1,653 @@ <?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.daoSe.SeClientCardMapper"> - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> - <!--@mbg.generated--> - <!--@Table se_client_card--> - <id column="id" jdbcType="BIGINT" property="id" /> - <result column="protocol" jdbcType="VARCHAR" property="protocol" /> - <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr" /> - <result column="cardNum" jdbcType="BIGINT" property="cardnum" /> - <result column="clientId" jdbcType="BIGINT" property="clientid" /> - <result column="money" jdbcType="FLOAT" property="money" /> - <result column="state" jdbcType="TINYINT" property="state" /> - <result column="original_card_id" jdbcType="BIGINT" property="originalCardId"/> - <result column="createDt" jdbcType="TIMESTAMP" property="createdt" /> - <result column="replaceDt" jdbcType="TIMESTAMP" property="replacedt" /> - <result column="rechargeDt" jdbcType="TIMESTAMP" property="rechargedt" /> - <result column="lossDtDt" jdbcType="TIMESTAMP" property="lossdtdt" /> - <result column="cancelDt" jdbcType="TIMESTAMP" property="canceldt" /> - <result column="unlockDt" jdbcType="TIMESTAMP" property="unlockdt" /> - <result column="reversalDt" jdbcType="TIMESTAMP" property="reversaldt" /> - <result column="refundDt" jdbcType="TIMESTAMP" property="refunddt" /> - <result column="consumeDt" jdbcType="TIMESTAMP" property="consumedt" /> - <result column="lastOper" jdbcType="TINYINT" property="lastoper" /> - <result column="remarks" jdbcType="VARCHAR" property="remarks" /> - </resultMap> - <sql id="Base_Column_List"> - <!--@mbg.generated--> - id, protocol, cardAddr, cardNum, clientId, money, `state`, original_card_id, createDt, replaceDt, rechargeDt, - lossDtDt, cancelDt, unlockDt, reversalDt, refundDt, consumeDt, lastOper, remarks - </sql> - <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> - <!--@mbg.generated--> - select - <include refid="Base_Column_List" /> - from se_client_card - where id = #{id,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> - <!--@mbg.generated--> - delete from se_client_card - where id = #{id,jdbcType=BIGINT} - </delete> - - <!--渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛�12鏈�19鏃ュ簾寮冿級--> - <select id="getCardIdByAddr" resultType="java.lang.Long"> - SELECT id AS cardId FROM se_client_card WHERE cardAddr = #{cardAddr} - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿紙12鏈�19鏃ユ坊鍔犲悗搴熷純锛�--> - <select id="getCardIdByNum" resultType="java.lang.Long"> - SELECT id AS cardId FROM se_client_card WHERE cardNum = #{cardNum} - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿--> - <select id="getCardIdAndClientNum" resultType="java.util.Map"> - <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> - SELECT - card.id AS cardId, - cli.clientNum, - cli.id AS clientId, - protocol - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - WHERE card.cardNum = #{cardNum} - </select> - - <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱瀵瑰簲鐨勫啘鎴穒d鍜屽鍚� --> - <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> - SELECT - cli.id AS clientId, - cli.name AS clientName - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - WHERE card.cardAddr = #{cardAddr} and card.cardNum = #{cardNum} - </select> - - - <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱 --> - <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> - SELECT - id, - money - FROM se_client_card - WHERE cardAddr = #{cardAddr} and cardNum = #{cardNum} - </select> - - <!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈡按鍗$紪鍙�--> - <select id="getCardNumOfMax" resultType="java.lang.String"> - SELECT cardNum - FROM se_client_card - WHERE cardNum LIKE CONCAT(#{areaCode},'%') - ORDER BY cardNum desc - LIMIT 0,1 - </select> - - <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> - <!--@mbg.generated--> - insert into se_client_card (id, protocol, cardAddr, cardNum, clientId, - money, `state`, original_card_id, createDt, - replaceDt, rechargeDt, lossDtDt, - cancelDt, unlockDt, reversalDt, refundDt, - consumeDt, lastOper, remarks - ) - values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, - #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, #{createdt,jdbcType=TIMESTAMP}, - #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, - #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, - #{refunddt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR} - ) - - </insert> - <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true"> - <!--@mbg.generated--> - insert into se_client_card - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> + <!--@mbg.generated--> + <!--@Table se_client_card--> + <id column="id" jdbcType="BIGINT" property="id"/> + <result column="protocol" jdbcType="VARCHAR" property="protocol"/> + <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr"/> + <result column="cardNum" jdbcType="BIGINT" property="cardnum"/> + <result column="clientId" jdbcType="BIGINT" property="clientid"/> + <result column="money" jdbcType="FLOAT" property="money"/> + <result column="state" jdbcType="TINYINT" property="state"/> + <result column="original_card_id" jdbcType="BIGINT" property="originalCardId"/> + <result column="createDt" jdbcType="TIMESTAMP" property="createdt"/> + <result column="replaceDt" jdbcType="TIMESTAMP" property="replacedt"/> + <result column="rechargeDt" jdbcType="TIMESTAMP" property="rechargedt"/> + <result column="lossDtDt" jdbcType="TIMESTAMP" property="lossdtdt"/> + <result column="cancelDt" jdbcType="TIMESTAMP" property="canceldt"/> + <result column="unlockDt" jdbcType="TIMESTAMP" property="unlockdt"/> + <result column="reversalDt" jdbcType="TIMESTAMP" property="reversaldt"/> + <result column="refundDt" jdbcType="TIMESTAMP" property="refunddt"/> + <result column="consumeDt" jdbcType="TIMESTAMP" property="consumedt"/> + <result column="lastOper" jdbcType="TINYINT" property="lastoper"/> + <result column="remarks" jdbcType="VARCHAR" property="remarks"/> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> id, - </if> - <if test="protocol != null"> protocol, - </if> - <if test="cardaddr != null"> cardAddr, - </if> - <if test="cardnum != null"> cardNum, - </if> - <if test="clientid != null"> clientId, - </if> - <if test="money != null"> money, - </if> - <if test="state != null"> `state`, - </if> - <if test="originalCardId != null"> original_card_id, - </if> - <if test="createdt != null"> createDt, - </if> - <if test="replacedt != null"> replaceDt, - </if> - <if test="rechargedt != null"> rechargeDt, - </if> - <if test="lossdtdt != null"> lossDtDt, - </if> - <if test="canceldt != null"> cancelDt, - </if> - <if test="unlockdt != null"> unlockDt, - </if> - <if test="reversaldt != null"> reversalDt, - </if> - <if test="refunddt != null"> refundDt, - </if> - <if test="consumedt != null"> consumeDt, - </if> - <if test="lastoper != null"> lastOper, - </if> - <if test="remarks != null"> - remarks, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="protocol != null"> - #{protocol,jdbcType=VARCHAR}, - </if> - <if test="cardaddr != null"> - #{cardaddr,jdbcType=VARCHAR}, - </if> - <if test="cardnum != null"> - #{cardnum,jdbcType=BIGINT}, - </if> - <if test="clientid != null"> - #{clientid,jdbcType=BIGINT}, - </if> - <if test="money != null"> - #{money,jdbcType=FLOAT}, - </if> - <if test="state != null"> - #{state,jdbcType=TINYINT}, - </if> - <if test="originalCardId != null"> - #{originalCardId,jdbcType=BIGINT}, - </if> - <if test="createdt != null"> - #{createdt,jdbcType=TIMESTAMP}, - </if> - <if test="replacedt != null"> - #{replacedt,jdbcType=TIMESTAMP}, - </if> - <if test="rechargedt != null"> - #{rechargedt,jdbcType=TIMESTAMP}, - </if> - <if test="lossdtdt != null"> - #{lossdtdt,jdbcType=TIMESTAMP}, - </if> - <if test="canceldt != null"> - #{canceldt,jdbcType=TIMESTAMP}, - </if> - <if test="unlockdt != null"> - #{unlockdt,jdbcType=TIMESTAMP}, - </if> - <if test="reversaldt != null"> - #{reversaldt,jdbcType=TIMESTAMP}, - </if> - <if test="refunddt != null"> - #{refunddt,jdbcType=TIMESTAMP}, - </if> - <if test="consumedt != null"> - #{consumedt,jdbcType=TIMESTAMP}, - </if> - <if test="lastoper != null"> - #{lastoper,jdbcType=TINYINT}, - </if> - <if test="remarks != null"> - #{remarks,jdbcType=VARCHAR}, - </if> - </trim> - </insert> - <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> - <!--@mbg.generated--> - update se_client_card - <set> - <if test="protocol != null"> - protocol = #{protocol,jdbcType=VARCHAR}, - </if> - <if test="cardaddr != null"> - cardAddr = #{cardaddr,jdbcType=VARCHAR}, - </if> - <if test="cardnum != null"> - cardNum = #{cardnum,jdbcType=BIGINT}, - </if> - <if test="clientid != null"> - clientId = #{clientid,jdbcType=BIGINT}, - </if> - <if test="money != null"> - money = #{money,jdbcType=FLOAT}, - </if> - <if test="state != null"> - `state` = #{state,jdbcType=TINYINT}, - </if> - <if test="originalCardId != null"> - `original_card_id` = #{originalCardId,jdbcType=BIGINT}, - </if> - <if test="createdt != null"> - createDt = #{createdt,jdbcType=TIMESTAMP}, - </if> - <if test="replacedt != null"> - replaceDt = #{replacedt,jdbcType=TIMESTAMP}, - </if> - <if test="rechargedt != null"> - rechargeDt = #{rechargedt,jdbcType=TIMESTAMP}, - </if> - <if test="lossdtdt != null"> - lossDtDt = #{lossdtdt,jdbcType=TIMESTAMP}, - </if> - <if test="canceldt != null"> - cancelDt = #{canceldt,jdbcType=TIMESTAMP}, - </if> - <if test="unlockdt != null"> - unlockDt = #{unlockdt,jdbcType=TIMESTAMP}, - </if> - <if test="reversaldt != null"> - reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, - </if> - <if test="refunddt != null"> - refundDt = #{refunddt,jdbcType=TIMESTAMP}, - </if> - <if test="consumedt != null"> - consumeDt = #{consumedt,jdbcType=TIMESTAMP}, - </if> - <if test="lastoper != null"> - lastOper = #{lastoper,jdbcType=TINYINT}, - </if> - <if test="remarks != null"> - remarks = #{remarks,jdbcType=VARCHAR}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> - <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> - <!--@mbg.generated--> - update se_client_card - set protocol = #{protocol,jdbcType=VARCHAR}, - cardAddr = #{cardaddr,jdbcType=VARCHAR}, - cardNum = #{cardnum,jdbcType=BIGINT}, - clientId = #{clientid,jdbcType=BIGINT}, - money = #{money,jdbcType=FLOAT}, - `state` = #{state,jdbcType=TINYINT}, - original_card_id = #{originalCardId,jdbcType=BIGINT}, - createDt = #{createdt,jdbcType=TIMESTAMP}, - replaceDt = #{replacedt,jdbcType=TIMESTAMP}, - rechargeDt = #{rechargedt,jdbcType=TIMESTAMP}, - lossDtDt = #{lossdtdt,jdbcType=TIMESTAMP}, - cancelDt = #{canceldt,jdbcType=TIMESTAMP}, - unlockDt = #{unlockdt,jdbcType=TIMESTAMP}, - reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, - refundDt = #{refunddt,jdbcType=TIMESTAMP}, - consumeDt = #{consumedt,jdbcType=TIMESTAMP}, - lastOper = #{lastoper,jdbcType=TINYINT}, - remarks = #{remarks,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - </update> - <update id="updateMoney" > - update se_client_card - set money = #{money,jdbcType=FLOAT} - where id = #{id,jdbcType=BIGINT} - </update> - <!--鏍规嵁鍐滄埛涓婚敭鑾峰彇姘村崱鍒楄〃锛堢墿鐞嗗崱+铏氭嫙鍗★級--> - <select id="getCardInfoByClientId" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo"> - SELECT - * - FROM - (SELECT - '鐗╃悊鍗�' AS cardType, - clientCard.cardNum AS CardNum, - clientCard.money AS Money, - (CASE - WHEN clientCard.state = 1 THEN '姝e父' - WHEN clientCard.state = 2 THEN '宸叉敞閿�' - ELSE '宸叉寕澶�' - END) AS State - FROM se_client client - LEFT JOIN se_client_card clientCard ON clientCard.clientId = client.id - WHERE client.id = #{clientId,jdbcType=BIGINT} - UNION ALL - SELECT - '铏氭嫙鍗�' AS cardType, - virtualCard.vc_num AS CardNum, - virtualCard.money AS vcMoney, - (CASE - WHEN virtualCard.in_use = 0 THEN '鏈娇鐢�' - WHEN virtualCard.in_use = 1 THEN '浣跨敤涓�' - END) AS State - FROM se_client client - LEFT JOIN se_virtual_card virtualCard ON client.id = virtualCard.client_id - WHERE client.id = #{clientId,jdbcType=BIGINT} - ) card - ORDER BY card.Money DESC , card.State DESC - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇鎿嶄綔璁板綍鍒楄〃--> - <select id="getOperateRecordsByCardNum" resultType="java.util.HashMap"> - SELECT * FROM v_operate WHERE cardNum = #{cardNum,jdbcType=BIGINT} - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇浣欓--> - <select id="getMoneyByCardNum" resultType="java.lang.Float"> - SELECT money FROM se_client_card WHERE cardNum = #{cardNum,jdbcType=BIGINT} - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇鍏呭�兼�婚--> - <select id="sumRechargeByCardNum" resultType="java.lang.Float"> - SELECT - SUM(his.amount) AS amount - FROM se_recharge_history his - INNER JOIN se_client_card card ON his.cardId = card.id - WHERE card.cardNum = #{cardNum,jdbcType=BIGINT} - </select> - - <!--鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵�侊細1-寮�鍗★紝2-琛ュ崱锛�3-鍏呭�硷紝4-鎸傚け锛�5-娉ㄩ攢锛�6-瑙i攣锛�7-鍐叉锛�8-娑堣垂--> - <select id="getCardStateByCardNum" resultType="java.lang.String"> -<!-- SELECT--> -<!-- (CASE--> -<!-- WHEN lastOper = 1 THEN "寮�鍗�"--> -<!-- WHEN lastOper = 2 THEN "琛ュ崱"--> -<!-- WHEN lastOper = 3 THEN "鍏呭��"--> -<!-- WHEN lastOper = 4 THEN "鎸傚け"--> -<!-- WHEN lastOper = 5 THEN "娉ㄩ攢"--> -<!-- WHEN lastOper = 6 THEN "瑙i攣"--> -<!-- WHEN lastOper = 7 THEN "鍐叉"--> -<!-- WHEN lastOper = 8 THEN "娑堣垂"--> -<!-- END) AS stateName--> -<!-- FROM se_client_card--> -<!-- WHERE cardNum = ${cardNum}--> - SELECT - (CASE - WHEN state = 1 THEN '姝e父' - WHEN state = 2 THEN '宸叉敞閿�' - WHEN state = 3 THEN '宸叉寕澶�' - END) AS stateName - FROM se_client_card - WHERE cardNum = #{cardNum,jdbcType=BIGINT} - </select> - - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃璁板綍鏁帮紝搴旂敤绋嬪簭浣跨敤--> - <select id="getCardsCount" parameterType="java.util.Map" resultType="java.lang.Long"> - SELECT - COUNT(*) AS recordCount - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - <where> - AND card.state = 1 - <if test = "clientNum != null and clientNum !=''"> - AND cli.clientNum like CONCAT('%',#{clientNum},'%') - </if> - - <if test = "clientName != null and clientName !=''"> - AND cli.name like CONCAT('%',#{clientName},'%') - </if> - - <if test = "cardNum != null and cardNum !=''"> - AND card.cardNum like CONCAT('%',#{cardNum},'%') - </if> - </where> - </select> - - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃锛屽簲鐢ㄧ▼搴忎娇鐢�--> - <select id="getCards" resultType="com.dy.pipIrrGlobal.voSe.VoCards"> - SELECT - cli.clientNum, - cli.name AS clientName, - cardNum, -<!-- CASE--> -<!-- WHEN card.cardNum LIKE '10%' THEN CONCAT(SUBSTRING(card.cardNum, 7, 6),SUBSTRING(card.cardNum, 14, 4))--> -<!-- ELSE card.cardNum--> -<!-- END AS cardNum,--> - cli.phone, - cli.idCard, - card.state AS cardState, -<!-- (CASE--> -<!-- WHEN card.state = 1 THEN '姝e父'--> -<!-- WHEN card.state = 2 THEN '宸叉敞閿�'--> -<!-- WHEN card.state = 3 THEN '宸叉寕澶�'--> -<!-- End) AS stateName,--> - '姝e父' AS stateName, - '鍐滄埛鍗�' AS cardType, - FORMAT(card.money, 2) AS money - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - <where> - AND card.state = 1 - <if test = "clientNum != null and clientNum !=''"> - AND cli.clientNum like CONCAT('%',#{clientNum},'%') - </if> - - <if test = "clientName != null and clientName !=''"> - AND cli.name like CONCAT('%',#{clientName},'%') - </if> - - <if test = "cardNum != null and cardNum !=''"> - AND card.cardNum like CONCAT('%',#{cardNum},'%') - </if> - </where> - ORDER BY card.id - <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="getUnreplacedRecordCount" resultType="java.lang.Long"> - SELECT - COUNT(*) AS recordCount - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - WHERE card.state = 3 AND NOT EXISTS (SELECT * FROM se_client_card card2 WHERE card2.original_card_id = card.cardNum) - </select> - - <!--鑾峰彇宸叉寕澶辨湭琛ュ崱鐨勮褰�--> - <select id="getUnreplaced" resultType="com.dy.pipIrrGlobal.voSe.VoCards"> - SELECT - cli.clientNum, - cli.name AS clientName, - cardNum, -<!-- CASE--> -<!-- WHEN card.cardNum LIKE '10%' THEN CONCAT(SUBSTRING(card.cardNum, 7, 6),SUBSTRING(card.cardNum, 14, 4))--> -<!-- ELSE card.cardNum--> -<!-- END AS cardNum,--> - cli.phone, - cli.idCard, - card.state AS cardState, - '宸叉寕澶�' AS stateName, - '鍐滄埛鍗�' AS cardType, - FORMAT(card.money,2) AS money - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - WHERE card.state = 3 AND NOT EXISTS (SELECT * FROM se_client_card card2 WHERE card2.original_card_id = card.id) - ORDER BY card.id - <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="getLostCount" resultType="java.lang.Integer"> - SELECT - COUNT(*) AS recordCount - FROM se_client_card card - <where> - AND card.state = 3 - <if test = "cardNum != null and cardNum > 0"> - AND card.cardNum = #{cardNum} - </if> - </where> - </select> - - <!--鏍规嵁鎸囧畾姘村崱缂栧彿鑾峰彇宸茶ˉ鍗℃暟閲忥紙琛ュ崱銆佽В閿佷娇鐢級--> - <select id="getReplacedCount" resultType="java.lang.Integer"> - SELECT - COUNT(*) AS recordCount - FROM se_client_card card - INNER JOIN se_client_card card2 ON card2.original_card_id = card.id - <where> - <if test = "cardNum != null and cardNum > 0"> - AND card.cardNum = #{cardNum} - </if> - </where> - </select> - <!--鏍规嵁鍐滄埛濮撳悕鍜屾墜鏈哄彿鑾峰彇姘村崱鍒楄〃璁板綍鏁帮紝搴旂敤绋嬪簭浣跨敤--> - <select id="getCardsByClientNameAndPhoneCount" resultType="java.lang.Long"> - SELECT - COUNT(*) AS recordCount - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - <where> - card.state = 1 - <if test = "clientName != null and clientName !=''"> - AND cli.name like CONCAT('%',#{clientName},'%') - </if> - - <if test = "phone != null and phone !=''"> - AND cli.phone like CONCAT('%',#{phone},'%') - </if> - </where> + remarks + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List"/> + from se_client_card + where id = #{id,jdbcType=BIGINT} </select> - <!--鏍规嵁鍐滄埛濮撳悕鍜屾墜鏈哄彿鑾峰彇姘村崱鍒楄〃锛屽簲鐢ㄧ▼搴忎娇鐢�--> - <select id="getCardsByClientNameAndPhone" resultType="com.dy.pipIrrGlobal.voSe.VoCards2"> - SELECT - card.id AS clientCardId, - cli.id AS clientId, - cli.clientNum, - cli.name AS clientName, - card.cardNum, - cli.phone, - cli.idCard, - card.state AS cardState, - (CASE - WHEN card.state = 1 THEN '姝e父' - WHEN card.state = 2 THEN '宸叉敞閿�' - WHEN card.state = 3 THEN '宸叉寕澶�' - End) AS stateName, - '鍐滄埛鍗�' AS cardType, - FORMAT(card.money, 2) AS money - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - <where> - card.state = 1 - <if test = "clientName != null and clientName !=''"> - AND cli.name like CONCAT('%',#{clientName},'%') - </if> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete + from se_client_card + where id = #{id,jdbcType=BIGINT} + </delete> - <if test = "phone != null and phone !=''"> - AND cli.phone like CONCAT('%',#{phone},'%') - </if> - </where> - ORDER BY card.id - <trim prefix="limit " > - <if test="start != null and count != null"> - #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} - </if> - </trim> - </select> - <!--鏍规嵁鍐滄埛ID鏌ヨ姝e父鐘舵�佺殑姘村崱鍒楄〃,灏忕▼搴忎娇鐢�--> - <select id="getCardsByClientID" resultType="com.dy.pipIrrGlobal.voWe.VoCards3"> - SELECT - card.id AS clientCardId, - cli.id AS clientId, - cli.clientNum, - cli.name AS clientName, - card.cardNum, - cli.phone, - cli.idCard, - card.state AS cardState, - (CASE - WHEN card.state = 1 THEN '姝e父' - WHEN card.state = 2 THEN '宸叉敞閿�' - WHEN card.state = 3 THEN '宸叉寕澶�' - End) AS stateName, - '鍐滄埛鍗�' AS cardType, - FORMAT(card.money, 2) AS money - FROM se_client_card card - INNER JOIN se_client cli ON card.clientId = cli.id - where - card.state = 1 - AND cli.id like CONCAT('%',#{clientId},'%') + <!--渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛�12鏈�19鏃ュ簾寮冿級--> + <select id="getCardIdByAddr" resultType="java.lang.Long"> + SELECT id AS cardId + FROM se_client_card + WHERE cardAddr = #{cardAddr} + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿紙12鏈�19鏃ユ坊鍔犲悗搴熷純锛�--> + <select id="getCardIdByNum" resultType="java.lang.Long"> + SELECT id AS cardId + FROM se_client_card + WHERE cardNum = #{cardNum} + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿--> + <select id="getCardIdAndClientNum" resultType="java.util.Map"> + <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> + SELECT card.id AS cardId, + cli.clientNum, + cli.id AS clientId, + protocol + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + WHERE card.cardNum = #{cardNum} + </select> + + <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱瀵瑰簲鐨勫啘鎴穒d鍜屽鍚� --> + <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> + SELECT cli.id AS clientId, + cli.name AS clientName + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + WHERE card.cardAddr = #{cardAddr} + and card.cardNum = #{cardNum} + </select> - ORDER BY card.id - </select> - <!--褰撳墠浣欓鎬婚噺锛堢墿鐞嗗崱锛�--> - <select id="getTotalMoneyIcCards" resultType="java.lang.Double"> - SELECT - IFNULL(SUM(money),0) AS totalMoney - FROM - `se_client_card` - WHERE state = 1 - </select> + <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇姘村崱 --> + <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> + SELECT id, + money + FROM se_client_card + WHERE cardAddr = #{cardAddr} + and cardNum = #{cardNum} + </select> + + <!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈡按鍗$紪鍙�--> + <select id="getCardNumOfMax" resultType="java.lang.String"> + SELECT cardNum + FROM se_client_card + WHERE cardNum LIKE CONCAT(#{areaCode}, '%') + ORDER BY cardNum desc + LIMIT 0,1 + </select> + + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> + <!--@mbg.generated--> + insert into se_client_card (id, protocol, cardAddr, cardNum, clientId, + money, `state`, original_card_id, createDt, + replaceDt, rechargeDt, lossDtDt, + cancelDt, unlockDt, reversalDt, refundDt, + consumeDt, lastOper, remarks) + values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardaddr,jdbcType=VARCHAR}, + #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, + #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, + #{createdt,jdbcType=TIMESTAMP}, + #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, + #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, + #{refunddt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, + #{remarks,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" + useGeneratedKeys="true"> + <!--@mbg.generated--> + insert into se_client_card + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="protocol != null"> + protocol, + </if> + <if test="cardaddr != null"> + cardAddr, + </if> + <if test="cardnum != null"> + cardNum, + </if> + <if test="clientid != null"> + clientId, + </if> + <if test="money != null"> + money, + </if> + <if test="state != null"> + `state`, + </if> + <if test="originalCardId != null"> + original_card_id, + </if> + <if test="createdt != null"> + createDt, + </if> + <if test="replacedt != null"> + replaceDt, + </if> + <if test="rechargedt != null"> + rechargeDt, + </if> + <if test="lossdtdt != null"> + lossDtDt, + </if> + <if test="canceldt != null"> + cancelDt, + </if> + <if test="unlockdt != null"> + unlockDt, + </if> + <if test="reversaldt != null"> + reversalDt, + </if> + <if test="refunddt != null"> + refundDt, + </if> + <if test="consumedt != null"> + consumeDt, + </if> + <if test="lastoper != null"> + lastOper, + </if> + <if test="remarks != null"> + remarks, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="protocol != null"> + #{protocol,jdbcType=VARCHAR}, + </if> + <if test="cardaddr != null"> + #{cardaddr,jdbcType=VARCHAR}, + </if> + <if test="cardnum != null"> + #{cardnum,jdbcType=BIGINT}, + </if> + <if test="clientid != null"> + #{clientid,jdbcType=BIGINT}, + </if> + <if test="money != null"> + #{money,jdbcType=FLOAT}, + </if> + <if test="state != null"> + #{state,jdbcType=TINYINT}, + </if> + <if test="originalCardId != null"> + #{originalCardId,jdbcType=BIGINT}, + </if> + <if test="createdt != null"> + #{createdt,jdbcType=TIMESTAMP}, + </if> + <if test="replacedt != null"> + #{replacedt,jdbcType=TIMESTAMP}, + </if> + <if test="rechargedt != null"> + #{rechargedt,jdbcType=TIMESTAMP}, + </if> + <if test="lossdtdt != null"> + #{lossdtdt,jdbcType=TIMESTAMP}, + </if> + <if test="canceldt != null"> + #{canceldt,jdbcType=TIMESTAMP}, + </if> + <if test="unlockdt != null"> + #{unlockdt,jdbcType=TIMESTAMP}, + </if> + <if test="reversaldt != null"> + #{reversaldt,jdbcType=TIMESTAMP}, + </if> + <if test="refunddt != null"> + #{refunddt,jdbcType=TIMESTAMP}, + </if> + <if test="consumedt != null"> + #{consumedt,jdbcType=TIMESTAMP}, + </if> + <if test="lastoper != null"> + #{lastoper,jdbcType=TINYINT}, + </if> + <if test="remarks != null"> + #{remarks,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> + <!--@mbg.generated--> + update se_client_card + <set> + <if test="protocol != null"> + protocol = #{protocol,jdbcType=VARCHAR}, + </if> + <if test="cardaddr != null"> + cardAddr = #{cardaddr,jdbcType=VARCHAR}, + </if> + <if test="cardnum != null"> + cardNum = #{cardnum,jdbcType=BIGINT}, + </if> + <if test="clientid != null"> + clientId = #{clientid,jdbcType=BIGINT}, + </if> + <if test="money != null"> + money = #{money,jdbcType=FLOAT}, + </if> + <if test="state != null"> + `state` = #{state,jdbcType=TINYINT}, + </if> + <if test="originalCardId != null"> + `original_card_id` = #{originalCardId,jdbcType=BIGINT}, + </if> + <if test="createdt != null"> + createDt = #{createdt,jdbcType=TIMESTAMP}, + </if> + <if test="replacedt != null"> + replaceDt = #{replacedt,jdbcType=TIMESTAMP}, + </if> + <if test="rechargedt != null"> + rechargeDt = #{rechargedt,jdbcType=TIMESTAMP}, + </if> + <if test="lossdtdt != null"> + lossDtDt = #{lossdtdt,jdbcType=TIMESTAMP}, + </if> + <if test="canceldt != null"> + cancelDt = #{canceldt,jdbcType=TIMESTAMP}, + </if> + <if test="unlockdt != null"> + unlockDt = #{unlockdt,jdbcType=TIMESTAMP}, + </if> + <if test="reversaldt != null"> + reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, + </if> + <if test="refunddt != null"> + refundDt = #{refunddt,jdbcType=TIMESTAMP}, + </if> + <if test="consumedt != null"> + consumeDt = #{consumedt,jdbcType=TIMESTAMP}, + </if> + <if test="lastoper != null"> + lastOper = #{lastoper,jdbcType=TINYINT}, + </if> + <if test="remarks != null"> + remarks = #{remarks,jdbcType=VARCHAR}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> + <!--@mbg.generated--> + update se_client_card + set protocol = #{protocol,jdbcType=VARCHAR}, + cardAddr = #{cardaddr,jdbcType=VARCHAR}, + cardNum = #{cardnum,jdbcType=BIGINT}, + clientId = #{clientid,jdbcType=BIGINT}, + money = #{money,jdbcType=FLOAT}, + `state` = #{state,jdbcType=TINYINT}, + original_card_id = #{originalCardId,jdbcType=BIGINT}, + createDt = #{createdt,jdbcType=TIMESTAMP}, + replaceDt = #{replacedt,jdbcType=TIMESTAMP}, + rechargeDt = #{rechargedt,jdbcType=TIMESTAMP}, + lossDtDt = #{lossdtdt,jdbcType=TIMESTAMP}, + cancelDt = #{canceldt,jdbcType=TIMESTAMP}, + unlockDt = #{unlockdt,jdbcType=TIMESTAMP}, + reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, + refundDt = #{refunddt,jdbcType=TIMESTAMP}, + consumeDt = #{consumedt,jdbcType=TIMESTAMP}, + lastOper = #{lastoper,jdbcType=TINYINT}, + remarks = #{remarks,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateMoney"> + update se_client_card + set money = #{money,jdbcType=FLOAT} + where id = #{id,jdbcType=BIGINT} + </update> + <!--鏍规嵁鍐滄埛涓婚敭鑾峰彇姘村崱鍒楄〃锛堢墿鐞嗗崱+铏氭嫙鍗★級--> + <select id="getCardInfoByClientId" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo"> + SELECT * + FROM (SELECT '鐗╃悊鍗�' AS cardType, + card.cardNum AS cardNum, + card.money AS money, + (CASE + WHEN card.state = 1 THEN '姝e父' + WHEN card.state = 2 THEN '宸叉敞閿�' + ELSE '宸叉寕澶�' + END) AS state + FROM se_client_card card + INNER JOIN se_client cli ON cli.id = card.clientId + WHERE card.clientId = #{clientId,jdbcType=BIGINT} + UNION ALL + SELECT '铏氭嫙鍗�' AS cardType, + vc.vc_num AS cardNum, + vc.money AS money, + (CASE + WHEN vc.in_use = 0 THEN '鏈娇鐢�' + WHEN vc.in_use = 1 THEN '浣跨敤涓�' + END) AS state + FROM se_virtual_card vc + INNER JOIN se_client cli ON cli.id = vc.client_id + WHERE vc.client_id = #{clientId,jdbcType=BIGINT} + <!-- SELECT '铏氭嫙鍗�' AS cardType,--> + <!-- virtualCard.vc_num AS CardNum,--> + <!-- virtualCard.money AS vcMoney,--> + <!-- (CASE--> + <!-- WHEN virtualCard.in_use = 0 THEN '鏈娇鐢�'--> + <!-- WHEN virtualCard.in_use = 1 THEN '浣跨敤涓�'--> + <!-- END) AS State--> + <!-- FROM se_client client--> + <!-- LEFT JOIN se_virtual_card virtualCard ON client.id = virtualCard.client_id--> + <!-- WHERE client.id = #{clientId,jdbcType=BIGINT}--> + ) card + ORDER BY card.Money DESC, card.State DESC + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇鎿嶄綔璁板綍鍒楄〃--> + <select id="getOperateRecordsByCardNum" resultType="java.util.HashMap"> + SELECT * + FROM v_operate + WHERE cardNum = #{cardNum,jdbcType=BIGINT} + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇浣欓--> + <select id="getMoneyByCardNum" resultType="java.lang.Float"> + SELECT money + FROM se_client_card + WHERE cardNum = #{cardNum,jdbcType=BIGINT} + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇鍏呭�兼�婚--> + <select id="sumRechargeByCardNum" resultType="java.lang.Float"> + SELECT SUM(his.amount) AS amount + FROM se_recharge_history his + INNER JOIN se_client_card card ON his.cardId = card.id + WHERE card.cardNum = #{cardNum,jdbcType=BIGINT} + </select> + + <!--鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵�侊細1-寮�鍗★紝2-琛ュ崱锛�3-鍏呭�硷紝4-鎸傚け锛�5-娉ㄩ攢锛�6-瑙i攣锛�7-鍐叉锛�8-娑堣垂--> + <select id="getCardStateByCardNum" resultType="java.lang.String"> + <!-- SELECT--> + <!-- (CASE--> + <!-- WHEN lastOper = 1 THEN "寮�鍗�"--> + <!-- WHEN lastOper = 2 THEN "琛ュ崱"--> + <!-- WHEN lastOper = 3 THEN "鍏呭��"--> + <!-- WHEN lastOper = 4 THEN "鎸傚け"--> + <!-- WHEN lastOper = 5 THEN "娉ㄩ攢"--> + <!-- WHEN lastOper = 6 THEN "瑙i攣"--> + <!-- WHEN lastOper = 7 THEN "鍐叉"--> + <!-- WHEN lastOper = 8 THEN "娑堣垂"--> + <!-- END) AS stateName--> + <!-- FROM se_client_card--> + <!-- WHERE cardNum = ${cardNum}--> + SELECT (CASE + WHEN state = 1 THEN '姝e父' + WHEN state = 2 THEN '宸叉敞閿�' + WHEN state = 3 THEN '宸叉寕澶�' + END) AS stateName + FROM se_client_card + WHERE cardNum = #{cardNum,jdbcType=BIGINT} + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃璁板綍鏁帮紝搴旂敤绋嬪簭浣跨敤--> + <select id="getCardsCount" parameterType="java.util.Map" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + <where> + AND card.state = 1 + <if test="clientNum != null and clientNum != ''"> + AND cli.clientNum like CONCAT('%', #{clientNum}, '%') + </if> + + <if test="clientName != null and clientName != ''"> + AND cli.name like CONCAT('%', #{clientName}, '%') + </if> + + <if test="cardNum != null and cardNum != ''"> + AND card.cardNum like CONCAT('%', #{cardNum}, '%') + </if> + </where> + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃锛屽簲鐢ㄧ▼搴忎娇鐢�--> + <select id="getCards" resultType="com.dy.pipIrrGlobal.voSe.VoCards"> + SELECT cli.clientNum, + cli.name AS clientName, + cardNum, + <!-- CASE--> + <!-- WHEN card.cardNum LIKE '10%' THEN CONCAT(SUBSTRING(card.cardNum, 7, 6),SUBSTRING(card.cardNum, 14, 4))--> + <!-- ELSE card.cardNum--> + <!-- END AS cardNum,--> + cli.phone, + cli.idCard, + card.state AS cardState, + <!-- (CASE--> + <!-- WHEN card.state = 1 THEN '姝e父'--> + <!-- WHEN card.state = 2 THEN '宸叉敞閿�'--> + <!-- WHEN card.state = 3 THEN '宸叉寕澶�'--> + <!-- End) AS stateName,--> + '姝e父' AS stateName, + '鍐滄埛鍗�' AS cardType, + FORMAT(card.money, 2) AS money + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + <where> + AND card.state = 1 + <if test="clientNum != null and clientNum != ''"> + AND cli.clientNum like CONCAT('%', #{clientNum}, '%') + </if> + + <if test="clientName != null and clientName != ''"> + AND cli.name like CONCAT('%', #{clientName}, '%') + </if> + + <if test="cardNum != null and cardNum != ''"> + AND card.cardNum like CONCAT('%', #{cardNum}, '%') + </if> + </where> + ORDER BY card.id + <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="getUnreplacedRecordCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + WHERE card.state = 3 + AND NOT EXISTS(SELECT * FROM se_client_card card2 WHERE card2.original_card_id = card.cardNum) + </select> + + <!--鑾峰彇宸叉寕澶辨湭琛ュ崱鐨勮褰�--> + <select id="getUnreplaced" resultType="com.dy.pipIrrGlobal.voSe.VoCards"> + SELECT cli.clientNum, + cli.name AS clientName, + cardNum, + <!-- CASE--> + <!-- WHEN card.cardNum LIKE '10%' THEN CONCAT(SUBSTRING(card.cardNum, 7, 6),SUBSTRING(card.cardNum, 14, 4))--> + <!-- ELSE card.cardNum--> + <!-- END AS cardNum,--> + cli.phone, + cli.idCard, + card.state AS cardState, + '宸叉寕澶�' AS stateName, + '鍐滄埛鍗�' AS cardType, + FORMAT(card.money, 2) AS money + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + WHERE card.state = 3 + AND NOT EXISTS(SELECT * FROM se_client_card card2 WHERE card2.original_card_id = card.id) + ORDER BY card.id + <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="getLostCount" resultType="java.lang.Integer"> + SELECT COUNT(*) AS recordCount + FROM se_client_card card + <where> + AND card.state = 3 + <if test="cardNum != null and cardNum > 0"> + AND card.cardNum = #{cardNum} + </if> + </where> + </select> + + <!--鏍规嵁鎸囧畾姘村崱缂栧彿鑾峰彇宸茶ˉ鍗℃暟閲忥紙琛ュ崱銆佽В閿佷娇鐢級--> + <select id="getReplacedCount" resultType="java.lang.Integer"> + SELECT COUNT(*) AS recordCount + FROM se_client_card card + INNER JOIN se_client_card card2 ON card2.original_card_id = card.id + <where> + <if test="cardNum != null and cardNum > 0"> + AND card.cardNum = #{cardNum} + </if> + </where> + </select> + <!--鏍规嵁鍐滄埛濮撳悕鍜屾墜鏈哄彿鑾峰彇姘村崱鍒楄〃璁板綍鏁帮紝搴旂敤绋嬪簭浣跨敤--> + <select id="getCardsByClientNameAndPhoneCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + <where> + card.state = 1 + <if test="clientName != null and clientName != ''"> + AND cli.name like CONCAT('%', #{clientName}, '%') + </if> + + <if test="phone != null and phone != ''"> + AND cli.phone like CONCAT('%', #{phone}, '%') + </if> + </where> + </select> + <!--鏍规嵁鍐滄埛濮撳悕鍜屾墜鏈哄彿鑾峰彇姘村崱鍒楄〃锛屽簲鐢ㄧ▼搴忎娇鐢�--> + <select id="getCardsByClientNameAndPhone" resultType="com.dy.pipIrrGlobal.voSe.VoCards2"> + SELECT card.id AS clientCardId, + cli.id AS clientId, + cli.clientNum, + cli.name AS clientName, + card.cardNum, + cli.phone, + cli.idCard, + card.state AS cardState, + (CASE + WHEN card.state = 1 THEN '姝e父' + WHEN card.state = 2 THEN '宸叉敞閿�' + WHEN card.state = 3 THEN '宸叉寕澶�' + End) AS stateName, + '鍐滄埛鍗�' AS cardType, + FORMAT(card.money, 2) AS money + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + <where> + card.state = 1 + <if test="clientName != null and clientName != ''"> + AND cli.name like CONCAT('%', #{clientName}, '%') + </if> + + <if test="phone != null and phone != ''"> + AND cli.phone like CONCAT('%', #{phone}, '%') + </if> + </where> + ORDER BY card.id + <trim prefix="limit "> + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> + <!--鏍规嵁鍐滄埛ID鏌ヨ姝e父鐘舵�佺殑姘村崱鍒楄〃,灏忕▼搴忎娇鐢�--> + <select id="getCardsByClientID" resultType="com.dy.pipIrrGlobal.voWe.VoCards3"> + SELECT card.id AS clientCardId, + cli.id AS clientId, + cli.clientNum, + cli.name AS clientName, + card.cardNum, + cli.phone, + cli.idCard, + card.state AS cardState, + (CASE + WHEN card.state = 1 THEN '姝e父' + WHEN card.state = 2 THEN '宸叉敞閿�' + WHEN card.state = 3 THEN '宸叉寕澶�' + End) AS stateName, + '鍐滄埛鍗�' AS cardType, + FORMAT(card.money, 2) AS money + FROM se_client_card card + INNER JOIN se_client cli ON card.clientId = cli.id + where card.state = 1 + AND cli.id like CONCAT('%', #{clientId}, '%') + + + ORDER BY card.id + </select> + <!--褰撳墠浣欓鎬婚噺锛堢墿鐞嗗崱锛�--> + <select id="getTotalMoneyIcCards" resultType="java.lang.Double"> + SELECT IFNULL(SUM(money), 0) AS totalMoney + FROM `se_client_card` + WHERE state = 1 + </select> + + <!--鏍规嵁姘村崱鍦板潃鑾峰彇姘村崱鏁伴噺--> + <select id="getCountByCardAddr" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client_card + WHERE cardAddr = #{cardAddr} + </select> + + <!--鏍规嵁姘村崱鍦板潃鑾峰彇鎸囧畾鐘舵�佺殑姘村崱鏁伴噺--> + <select id="getCountByCardAddrAndState" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client_card + WHERE cardAddr = #{cardAddr} + AND state IN (1, 3) + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-parent.iml b/pipIrr-platform/pipIrr-parent.iml deleted file mode 100644 index 4ae5c36..0000000 --- a/pipIrr-platform/pipIrr-parent.iml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_16"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java index 777bc6c..3cf6d65 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/PipIrrBaseApplication.java @@ -18,7 +18,7 @@ }) } ) -@MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoSe","com.dy.pipIrrGlobal.daoRm"}) +@MapperScan(basePackages={"com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoSe","com.dy.pipIrrGlobal.daoRm","com.dy.pipIrrGlobal.daoPr"}) public class PipIrrBaseApplication { public static void main(String[] args) { diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java index 58b1b24..b10b657 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictCtrl.java @@ -4,6 +4,7 @@ import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.pipIrrGlobal.voBa.VoDictItem; +import com.dy.pipIrrGlobal.voBa.VoMapCenter; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -40,4 +41,25 @@ return BaseResponseUtils.buildSuccess(dictSv.getDictItemsByDictCode(dictCode)); } + /** + * 鏍规嵁閰嶇疆椤瑰悕绉拌幏鍙栭厤缃」鍊� + * @param itemName + * @return + */ + @GetMapping(path = "setting") + @SsoAop() + public BaseResponse<String> getSettingValue(String itemName) { + return BaseResponseUtils.buildSuccess(dictSv.getItemValue(itemName)); + } + + /** + * 鑾峰彇鍦板浘涓績鍧愭爣 + * @return + */ + @GetMapping(path = "map_center") + @SsoAop + public BaseResponse<VoMapCenter> getMapCenter() { + return BaseResponseUtils.buildSuccess(dictSv.getMapCenter()); + } + } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java index 0f6e424..f59b604 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/dict/DictSv.java @@ -1,11 +1,14 @@ package com.dy.pipIrrBase.dict; import com.dy.pipIrrGlobal.daoBa.BaDictItemMapper; +import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; import com.dy.pipIrrGlobal.voBa.VoDictItem; +import com.dy.pipIrrGlobal.voBa.VoMapCenter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -23,6 +26,9 @@ @Autowired private BaDictItemMapper dictItemMapper; + @Autowired + private BaSettingsMapper baSettingsMapper; + /** * 鏍规嵁瀛楀吀Code鑾峰彇瀛楀吀椤� * @param dictCode @@ -32,4 +38,27 @@ List<VoDictItem> rs = Optional.ofNullable(dictItemMapper.getDictItemsByDictCode(dictCode)).orElse(new ArrayList<>()); return rs ; } + + /** + * 鏍规嵁閰嶇疆椤瑰悕绉拌幏鍙栭厤缃」鍊� + * @param itemName + * @return + */ + public String getItemValue(String itemName) { + return baSettingsMapper.getItemValue(itemName); + } + + /** + * 鑾峰彇鍦板浘涓績鍧愭爣 + * @return + */ + public VoMapCenter getMapCenter() { + BigDecimal lat = new BigDecimal(baSettingsMapper.getItemValue("lat")); + BigDecimal lng = new BigDecimal(baSettingsMapper.getItemValue("lng")); + + VoMapCenter po = new VoMapCenter(); + po.setLat(lat); + po.setLng(lng); + return po; + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java index 033a2f9..f75cd48 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java @@ -9,9 +9,11 @@ import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrBase.district.qo.DistrictQO; import com.dy.pipIrrGlobal.pojoBa.BaClient; import com.dy.pipIrrGlobal.pojoBa.BaDistrict; import com.dy.pipIrrGlobal.util.DistrictLevel; +import com.dy.pipIrrGlobal.voBa.VoDistrict; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -324,4 +326,29 @@ //return BaseResponseUtils.buildSuccess(); } + + /** + * 鏍规嵁鍖哄垝浠g爜鏌ヨ鎸囧畾绾у埆琛屾斂鍖哄垝 + * @param qo + * @return + */ + @GetMapping(path = "/districts") + @SsoAop() + public BaseResponse<List<VoDistrict>> getDistrictS(DistrictQO qo) { + String aredCode = qo.getAredCode(); + Integer level = qo.getLevel(); + + if((aredCode.trim().length() == 6 && level == 4) || (aredCode.trim().length() == 9 && level == 5)) { + try { + return BaseResponseUtils.buildSuccess(sv.getDistrictS(qo)); + } catch (Exception e) { + log.error("鑾峰彇寮�鍗¤褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + }else { + return BaseResponseUtils.buildErrorMsg("琛屾斂鍖哄垝浣嶆暟涓庣骇鍒笉鍖归厤"); + } + + + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java index 48e7256..e3fdb4f 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java @@ -1,8 +1,11 @@ package com.dy.pipIrrBase.district; +import com.dy.pipIrrBase.district.qo.DistrictQO; +import com.dy.pipIrrGlobal.daoBa.AreaCode2023Mapper; import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; import com.dy.pipIrrGlobal.pojoBa.BaDistrict; import com.dy.pipIrrGlobal.util.DistrictLevel; +import com.dy.pipIrrGlobal.voBa.VoDistrict; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,10 +19,16 @@ public class DistrictSv { private BaDistrictMapper dao; + private AreaCode2023Mapper areaCode2023Dao; @Autowired private void setDao(BaDistrictMapper dao){ this.dao = dao; + } + + @Autowired + private void setDao(AreaCode2023Mapper areaCode2023Dao){ + this.areaCode2023Dao = areaCode2023Dao; } /** @@ -117,4 +126,13 @@ public List<Map<String, Object>> getDistrictsBySupperId(Long supperId) { return dao.getDistrictsBySupperId(supperId); } + + /** + * 鏍规嵁鍖哄垝浠g爜鏌ヨ鎸囧畾绾у埆琛屾斂鍖哄垝 + * @param qo + * @return + */ + public List<VoDistrict> getDistrictS(DistrictQO qo) { + return areaCode2023Dao.getDistrictS(qo.getAredCode(), qo.getLevel()); + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/qo/DistrictQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/qo/DistrictQO.java new file mode 100644 index 0000000..25fed02 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/qo/DistrictQO.java @@ -0,0 +1,21 @@ +package com.dy.pipIrrBase.district.qo; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ZhuBaoMin + * @date 2024-08-30 16:28 + * @LastEditTime 2024-08-30 16:28 + * @Description + */ + +@Data +@EqualsAndHashCode(callSuper = false) +public class DistrictQO { + + private String aredCode; + + private Integer level; + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java index 08dd62f..eaf3213 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java @@ -5,15 +5,13 @@ import com.dy.common.mybatis.envm.Disabled; import com.dy.common.util.ConfigXml4Springboot; import com.dy.common.util.MD5; -import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; -import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; -import com.dy.pipIrrGlobal.daoBa.BaUserMapper; +import com.dy.pipIrrGlobal.daoBa.*; +import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; import com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper; -import com.dy.pipIrrGlobal.pojoBa.BaDistrict; -import com.dy.pipIrrGlobal.pojoBa.BaSettings; -import com.dy.pipIrrGlobal.pojoBa.BaUser; +import com.dy.pipIrrGlobal.pojoBa.*; +import com.dy.pipIrrGlobal.pojoPr.PrWaterPrice; import com.dy.pipIrrGlobal.pojoRm.RmIrrigateProfile; import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; import com.dy.pipIrrGlobal.pojoSe.SeWaterType; @@ -43,6 +41,9 @@ private BaSettingsMapper settingsDao ; private SeWaterTypeMapper waterTypeDao ; private RmIrrigateProfileMapper rmIrrigateProfileDao; + private PrWaterPriceMapper prWaterPriceDao; + private BaDictMapper baDictDao; + private BaDictItemMapper baDictItemDao; @Autowired public void setResourceLoader(ResourceLoader resourceLoader){ @@ -77,6 +78,21 @@ @Autowired public void setRmIrrigateProfileDao(RmIrrigateProfileMapper rmIrrigateProfileDao) { this.rmIrrigateProfileDao = rmIrrigateProfileDao; + } + + @Autowired + public void setWaterPriceDao(PrWaterPriceMapper prWaterPriceDao) { + this.prWaterPriceDao = prWaterPriceDao; + } + + @Autowired + public void setBaDictDao(BaDictMapper baDictDao) { + this.baDictDao = baDictDao; + } + + @Autowired + public void setBaDictItemDao(BaDictItemMapper baDictItemDao) { + this.baDictItemDao = baDictItemDao; } /** @@ -178,13 +194,53 @@ if(configXml.existElement(doc, "config.orgs.org" + num + ".irrigateProfile")){ for(int i = 1 ; i < 10000; i++){ if(configXml.existElement(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i)){ - String default_value = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i,"default_value", null, false, null) ; + String defaultValue = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i,"defaultValue", null, false, null) ; String unit = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i,"unit", null, false, null) ; String sort = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i,"sort", null, false, null) ; String type = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".irrigateProfile.item" + i,"type", null, false, null) ; - this.saveIrrigateProfile(orgTag, default_value, unit,sort,type); + this.saveIrrigateProfile(orgTag, defaultValue, unit,sort,type); }else{ break ; + } + } + } + } + if(!this.existWaterTypes()){ + if(configXml.existElement(doc, "config.orgs.org" + num + ".waterTypes")){ + for(int i = 1 ; i < 10000; i++){ + if(configXml.existElement(doc, "config.orgs.org" + num + ".waterTypes.item" + i)){ + String typeName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".waterTypes.item" + i,"typeName", null, false, null) ; + this.saveWaterType(orgTag, typeName); + }else{ + break ; + } + } + } + } + if(!this.existWaterPrice()){ + if(configXml.existElement(doc, "config.orgs.org" + num + ".waterPrice")){ + String price = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".waterPrice","price", null, false, null) ; + this.saveWaterPrice(orgTag, price); + } + } + if(!this.existDict()){ + if(configXml.existElement(doc, "config.orgs.org" + num + ".dictionaries.dict")){ + String code = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict","code", null, false, null) ; + String title = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict","title", null, false, null) ; + String valueType = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict","valueType", null, false, null) ; + this.saveDicts(orgTag, code,title,valueType); + if(configXml.existElement(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem")){ + for(int i = 1 ; i < 10000; i++){ + if(configXml.existElement(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i)){ + String dictCode = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i,"dictCode", null, false, null) ; + String value = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i,"value", null, false, null) ; + String name = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i,"name", null, false, null) ; + String status = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i,"status", null, false, null) ; + String sort = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".dictionaries.dict.dictItem.item" + i,"sort", null, false, null) ; + this.saveDictItems(orgTag,dictCode,value,name,status,sort); + }else{ + break ; + } } } } @@ -238,7 +294,7 @@ * @return 瀛樺湪鍚� */ private boolean existWaterTypes(){ - Long total = this.waterTypeDao.selectCount(null) ; + Long total = this.prWaterPriceDao.selectCount(null) ; return (total != null && total > 0) ; } @@ -248,6 +304,24 @@ */ private boolean existIrrigateProfile(){ Long total = this.rmIrrigateProfileDao.selectCount(null) ; + return (total != null && total > 0) ; + } + + /** + * 鏁版嵁搴撲腑鏄惁瀛樺湪姘翠环 + * @return + */ + private boolean existWaterPrice() { + Long total = this.prWaterPriceDao.selectCount(null); + return (total != null && total > 0) ; + } + + /** + * 鏁版嵁搴撲腑鏄惁瀛樺湪瀛楀吀 + * @return + */ + private boolean existDict() { + Long total = this.baDictDao.selectCount(null); return (total != null && total > 0) ; } @@ -366,8 +440,73 @@ po.setUnit(Byte.valueOf(unit)); po.setSort(Integer.parseInt(sort)); po.setType(Byte.valueOf(type)); + po.setDeleted(0L); this.rmIrrigateProfileDao.insert(po); } } + /** + * 淇濆瓨姘翠环 + * @param price + */ + private void saveWaterPrice(String orgTag, String price) { + if(price != null && !price.trim().equals("")) { + PrWaterPrice po = new PrWaterPrice(); + po.setPrice(Double.parseDouble(price)); + po.setDeleted((byte)0); + this.prWaterPriceDao.insert(po); + } + } + + /** + * 淇濆瓨瀛楀吀 + * @param orgTag + * @param code + * @param title + * @param valueType + * @return + */ + private void saveDicts(String orgTag, String code, String title, String valueType) { + if((code != null && !code.trim().equals("")) && + (title != null && !title.trim().equals("")) && + (valueType != null && !valueType.trim().equals(""))) { + BaDict po = new BaDict(); + po.setCode(code); + po.setTitle(title); + po.setValueType(Byte.valueOf(valueType)); + po.setHashCode("c4ca4238a0b923820dcc509a6f75849b"); + po.setDeleted(0L); + this.baDictDao.insert(po); + } + } + + /** + * 淇濆瓨瀛楀吀椤� + * @param orgTag + * @param dictCode + * @param value + * @param name + * @param status + * @param sort + */ + private void saveDictItems(String orgTag, String dictCode, String value, String name, String status, String sort) { + if((dictCode != null && !dictCode.trim().equals("")) && + (value != null && !value.trim().equals("")) && + (name != null && !name.trim().equals("")) && + (status != null && !status.trim().equals("")) && + (sort != null && !sort.trim().equals(""))) { + BaDictItem po = new BaDictItem(); + po.setDictCode(dictCode); + po.setValue(value); + po.setName(name); + po.setStatus(Byte.valueOf(status)); + po.setSort(Integer.parseInt(sort)); + po.setDeleted(0L); + this.baDictItemDao.insert(po); + } + + } + + + } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java index 3b1096a..053f427 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java @@ -67,12 +67,13 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(QueryVo vo){ try { - QueryResultVo<List<VoDivide>> res = divideSv.getDivides(vo); - if(res.itemTotal != null && res.itemTotal > 0) { - return BaseResponseUtils.buildSuccess(res); - }else { - return BaseResponseUtils.buildSuccess(ProjectResultCode.NO_DIVIDES.getMessage()); - } + //QueryResultVo<List<VoDivide>> res = divideSv.getDivides(vo); + //if(res.itemTotal != null && res.itemTotal > 0) { + // return BaseResponseUtils.buildSuccess(res); + //}else { + // return BaseResponseUtils.buildSuccess(ProjectResultCode.NO_DIVIDES.getMessage()); + //} + return BaseResponseUtils.buildSuccess(divideSv.getDivides(vo)); } catch (Exception e) { log.error("鑾峰彇寮�鍗¤褰曞紓甯�", e); return BaseResponseUtils.buildException(e.getMessage()) ; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java index d17f46c..c38df7c 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java @@ -114,7 +114,7 @@ if(timeStart_open != null && timeStart_open != "") { timeStart_open = timeStart_open + " 00:00:00"; } else { - timeStart_open = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); + timeStart_open = LocalDate.now() + " 00:00:00"; } qo.setTimeStop_open(timeStart_open); @@ -130,7 +130,7 @@ if(timeStart_close != null && timeStart_close != "") { timeStart_close = timeStart_close + " 00:00:00"; } else { - timeStart_close = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); + timeStart_close = LocalDate.now() + " 00:00:00"; } qo.setTimeStart_close(timeStart_close); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java index 5bc30ff..ba2542c 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java @@ -76,6 +76,11 @@ return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } + // 渚濇嵁姘村崱鍦板潃鍒ゆ柇璇ュ崱鏄惁鍙互寮�鍗★紝鏈紑杩囧崱鎴栦笉鏄甯哥姸鎬併�佹寕澶辩姸鎬佺殑鍙紑鍗� + if(!cardOperateSv.canActiveCard(po.getCardAddr())) { + return BaseResponseUtils.buildErrorMsg(SellResultCode.ACTIVE_FAIL_CARD_ESIST.getMessage()); + } + Long clientId = po.getClientId(); // 鑾峰彇5绾ц鏀垮尯鍒掍覆areaCode @@ -153,7 +158,13 @@ seCardOperate.setMoney(0f); seCardOperate.setCardCost(cardCost); seCardOperate.setPaymentId(paymentId); - seCardOperate.setOperateType(OperateTypeENUM.ACTIVE.getCode()); + if(originalCardId != null) { + // 琛ュ崱 + seCardOperate.setOperateType(OperateTypeENUM.REISSUE.getCode()); + }else { + // 寮�鏂板崱 + seCardOperate.setOperateType(OperateTypeENUM.ACTIVE.getCode()); + } seCardOperate.setRemarks(remarks); seCardOperate.setOperator(operator); seCardOperate.setOperateDt(activeTime); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java index 76bb686..a927bb2 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java @@ -491,4 +491,26 @@ public Double getTradeAmountByCardNo(Long cardNum) { return seCardOperateMapper.getTradeAmountByCardNo(cardNum); } + + /** + * 鏍规嵁姘村崱鍦板潃鍒ゆ柇璇ュ崱鏄惁鍙互寮�鍗� + * @param cardAddr + * @return + */ + public Boolean canActiveCard(String cardAddr) { + + // 鎸囧畾姘村崱鍦板潃鐨勬按鍗℃暟閲� + Long cardCount = Optional.ofNullable(seClientCardMapper.getCountByCardAddr(cardAddr)).orElse(0L); + if(cardCount == 0) { + return true; + } + + // 鎸囧畾姘村崱鍦板潃涓旀甯哥姸鎬佹垨鎸傚け鐘舵�佺殑姘村崱鏁伴噺 + cardCount = Optional.ofNullable(seClientCardMapper.getCountByCardAddrAndState(cardAddr)).orElse(0L); + if(cardCount == 0) { + return true; + } + + return false; + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java index 5acba42..ef8f6fa 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java @@ -19,6 +19,7 @@ AREA_CODE_MISTAKE(10001, "璇ュ啘鎴疯鏀垮尯鍒掑紓甯�"), CLIENT_NUM_ERROR(10001, "鍐滄埛缂栧彿閿欒"), CARD_NUMBER_OVERRUN(10002, "姘村崱缂栧彿宸叉弧"), + ACTIVE_FAIL_CARD_ESIST(10005, "寮�鍗″け璐�-姝ゅ崱宸插瓨鍦�"), ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR(10003, "寮�鍗″け璐�-鍐滄埛鍗″啓鍏ュ紓甯�"), ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR(10004, "寮�鍗″け璐�-寮�鍗¤褰曞啓鍏ュ紓甯�"), ACTIVE_FAIL_RECHARGE_EXCEPTION(10005, "寮�鍗″け璐�-鍏呭�煎紓甯�"), diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/LoginVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/LoginVo.java index 0b9fad1..cf1501b 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/LoginVo.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/LoginVo.java @@ -26,7 +26,7 @@ @Schema(description = "瀵嗙爜", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "瀵嗙爜涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null - @Length(message = "瀵嗙爜蹇呴』{min}浣�", min = 5, max = 20) + @Length(message = "瀵嗙爜涓嶅皬浜巤min}浣�", min = 5, max = 30) public String password ; @Schema(description = "缁勭粐鍗曚綅", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java index 1b116c0..77e36a9 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java @@ -329,7 +329,7 @@ Integer openType = qo.getOpenType(); String openTypeName = ""; if (openType == null){ - openTypeName = "鏈煡"; + openTypeName = "涓嶇煡閬撴偍瑕佹煡閭g寮�闃�绫诲瀷"; }else { switch (openType) { case 1: @@ -348,7 +348,7 @@ openTypeName = "寮�鍏抽榾鍗″紑闃�"; break; default: - openTypeName = "鏈煡"; + openTypeName = "涓嶇煡閬撴偍瑕佹煡閭g寮�闃�绫诲瀷"; } } @@ -374,52 +374,59 @@ */ String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); - if(timeStart != null) { - timeStart = timeStart + " 00:00:00"; - }else { - timeStart = LocalDate.now() + " 00:00:00"; - } if(timeStop != null) { timeStop = timeStop + " 23:59:59"; + if(timeStart != null) { + timeStart = timeStart + " 00:00:00"; + }else { + timeStart = LocalDate.now() + " 00:00:00"; + } + }else { + timeStart = null; } qo.setTimeStart(timeStart); qo.setTimeStop(timeStop); Integer closeType = qo.getCloseType(); String closeTypeName = ""; - switch (closeType) { - case 2: - closeTypeName = "鍒峰崱鍏抽榾"; - break; - case 4: - closeTypeName = "涓績绔欏叧闃�"; - break; - case 5: - closeTypeName = "娆犺垂鍏抽榾"; - break; - case 6: - closeTypeName = "娴侀噺璁℃晠闅滃叧闃�"; - break; - case 7: - closeTypeName = "绱ф�ュ叧闃�"; - break; - case 9: - closeTypeName = "鐢ㄦ埛杩滅▼鍏抽榾"; - break; - case 10: - closeTypeName = "寮�鍏抽榾鍗″叧闃�"; - break; - case 12: - closeTypeName = "榛戝悕鍗曞懡浠ゅ叧闃�"; - break; - case 13: - closeTypeName = "杩滅▼瀹氭椂鍏抽榾"; - break; - case 14: - closeTypeName = "杩滅▼瀹氶噺鍏抽榾"; - break; + if (closeType == null){ + closeTypeName = "涓嶇煡閬撴偍瑕佹煡閭g鍏抽榾绫诲瀷"; + }else { + switch (closeType) { + case 2: + closeTypeName = "鍒峰崱鍏抽榾"; + break; + case 4: + closeTypeName = "涓績绔欏叧闃�"; + break; + case 5: + closeTypeName = "娆犺垂鍏抽榾"; + break; + case 6: + closeTypeName = "娴侀噺璁℃晠闅滃叧闃�"; + break; + case 7: + closeTypeName = "绱ф�ュ叧闃�"; + break; + case 9: + closeTypeName = "鐢ㄦ埛杩滅▼鍏抽榾"; + break; + case 10: + closeTypeName = "寮�鍏抽榾鍗″叧闃�"; + break; + case 12: + closeTypeName = "榛戝悕鍗曞懡浠ゅ叧闃�"; + break; + case 13: + closeTypeName = "杩滅▼瀹氭椂鍏抽榾"; + break; + case 14: + closeTypeName = "杩滅▼瀹氶噺鍏抽榾"; + break; + default: + closeTypeName = "涓嶇煡閬撴偍瑕佹煡閭g鍏抽榾绫诲瀷"; + } } - // 鐢熸垚鏌ヨ鍙傛暟 Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; Integer closeTypeCount = Optional.ofNullable(rmOpenCloseValveLastMapper.getCountByCloseType(params)).orElse(0); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java index ad73d73..6a999b5 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java @@ -44,7 +44,7 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(@Valid CommonQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { @@ -64,7 +64,7 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getLargeFlowIntakes(@Valid CumulativeFlowQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getLargeFlowIntakes(qo)); @@ -83,7 +83,7 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getSmallFlowIntakes(@Valid CumulativeFlowQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getSmallFlowIntakes(qo)); @@ -102,7 +102,7 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoBatteryVolt>>> getUnderVoltIntakes(@Valid BatteryVoltQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getUnderVoltIntakes(qo)); @@ -121,7 +121,7 @@ @SsoAop() public BaseResponse<QueryResultVo<List<VoSignalIntensity>>> getSpecifiedSignalIntakes(@Valid SignalIntensityQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getSpecifiedSignalIntakes(qo)); @@ -140,7 +140,7 @@ @SsoAop() public BaseResponse<QueryResultVo<VoCountOfOpenType>> getCountByOpenType(@Valid OpenTypeQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getCountByOpenType(qo)); @@ -159,7 +159,7 @@ @SsoAop() public BaseResponse<QueryResultVo<VoCountOfCloseType>> getCountByCloseType(@Valid CloseTypeQo qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ - return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } try { return BaseResponseUtils.buildSuccess(intakeSv.getCountByCloseType(qo)); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/CloseTypeQo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/CloseTypeQo.java index a5635cb..912736f 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/CloseTypeQo.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/CloseTypeQo.java @@ -19,7 +19,7 @@ /** * 鍏抽榾绫诲瀷 */ - @NotNull(message = "鍏抽榾绫诲瀷涓嶈兘涓虹┖") +// @NotNull(message = "鍏抽榾绫诲瀷涓嶈兘涓虹┖") private Integer closeType; /** @@ -32,6 +32,6 @@ * 缁撴潫鏃堕棿 */ @JsonFormat(pattern = "yyyy-MM-dd") - @NotBlank(message = "缁撴潫鏃堕棿涓嶈兘涓虹┖") +// @NotBlank(message = "缁撴潫鏃堕棿涓嶈兘涓虹┖") private String timeStop; } -- Gitblit v1.8.0