Просмотр исходного кода

[电表][修改]:增加采集器电表数量字段

release_toaliyun_real
hupeng 6 лет назад
Родитель
Сommit
db75022fe7
3 измененных файлов: 15 добавлений и 18 удалений
  1. +5
    -2
      mallinkService/src/main/java/com/iformall/domain/po/KwBox.java
  2. +9
    -2
      mallinkService/src/main/resources/mapper/KwBoxMapper.xml
  3. +1
    -14
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml

+ 5
- 2
mallinkService/src/main/java/com/iformall/domain/po/KwBox.java Просмотреть файл

@@ -1,5 +1,6 @@
package com.iformall.domain.po; package com.iformall.domain.po;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -16,7 +17,7 @@ import java.util.List;
*/ */
@Table(name = "kw_box") @Table(name = "kw_box")
@Data @Data
@ToString(callSuper = true)
@JsonIgnoreProperties(value = {"handler"})
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class KwBox extends BaseEntity { public class KwBox extends BaseEntity {
@Id @Id
@@ -72,8 +73,10 @@ public class KwBox extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "最大目标数量", name = "maxTagNum") @io.swagger.annotations.ApiModelProperty(value = "最大目标数量", name = "maxTagNum")
private Integer maxTagNum; private Integer maxTagNum;


@io.swagger.annotations.ApiModelProperty(value = "已连接电表数", name = "meterCount")
private Integer meterCount;

@Transient @Transient
private List<KwMeter> meters; private List<KwMeter> meters;



} }

+ 9
- 2
mallinkService/src/main/resources/mapper/KwBoxMapper.xml Просмотреть файл

@@ -19,6 +19,7 @@
<result column="com_key" jdbcType="VARCHAR" property="comKey"/> <result column="com_key" jdbcType="VARCHAR" property="comKey"/>
<result column="status" jdbcType="INTEGER" property="status"/> <result column="status" jdbcType="INTEGER" property="status"/>
<result column="max_tag_num" jdbcType="INTEGER" property="maxTagNum"/> <result column="max_tag_num" jdbcType="INTEGER" property="maxTagNum"/>
<result column="meterCount" jdbcType="INTEGER" property="meterCount"/>
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
@@ -69,11 +70,17 @@
</if> </if>
<if test=" null != sortColumns">order by ${sortColumns}</if> <if test=" null != sortColumns">order by ${sortColumns}</if>
</sql> </sql>
<select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap"> <select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap">
select select
<include refid="allColumns"/> <include refid="allColumns"/>
from kw_box
,IFNULL(mc,0) as meterCount
from kw_box left join (
select box_id, count(box_id) as mc from kw_meter
where `status` = 0
and `bind_status` = 0
group by box_id
) meter on meter.box_id = id
<include refid="dynamicWhereConditions"/> <include refid="dynamicWhereConditions"/>
</select> </select>




+ 1
- 14
mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml Просмотреть файл

@@ -64,15 +64,6 @@
</if> </if>
</select> </select>


<select id="countMeterList" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(*) from kw_merchant_meter mm
left join kw_meter m on mm.`meter_id` = m.id
where mm.`status` = 0
<if test=" null != merchantId ">
and mm.`merchant_id` = #{merchantId}
</if>
</select>

<resultMap id="BaseResultMapListVo" type="com.iformall.domain.vo.KwMerchantMeterVo"> <resultMap id="BaseResultMapListVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
@@ -81,10 +72,6 @@
<result column="name" jdbcType="VARCHAR" property="merchantName"/> <result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/> <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>


<association column="{merchantId=id}" property="meterCount"
select="com.iformall.mapper.KwMerchantMeterMapper.countMeterList">
</association>

<collection column="{merchantId=id}" property="meterList" <collection column="{merchantId=id}" property="meterList"
ofType="com.iformall.domain.po.kwMeter" ofType="com.iformall.domain.po.kwMeter"
javaType="java.util.List" javaType="java.util.List"
@@ -157,7 +144,7 @@
</collection> </collection>


<collection column="{merchantId=id}" property="meterList" <collection column="{merchantId=id}" property="meterList"
ofType="com.iformall.domain.po.kwMeter"
ofType="com.iformall.domain.po.KwMeter"
javaType="java.util.List" javaType="java.util.List"
select="com.iformall.mapper.KwMerchantMeterMapper.findMeterList"> select="com.iformall.mapper.KwMerchantMeterMapper.findMeterList">
</collection> </collection>


Загрузка…
Отмена
Сохранить