Ver a proveniência

[电表][修改]:优化商户电表的接口

release_toaliyun_real
hupeng há 6 anos
ascendente
cometimento
9eadd5c6ad
7 ficheiros alterados com 79 adições e 35 eliminações
  1. +0
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java
  2. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/dto/KwMerchantMeterDto.java
  3. +2
    -1
      mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java
  4. +0
    -1
      mallinkService/src/main/java/com/iformall/mapper/KwMerchantMeterMapper.java
  5. +1
    -1
      mallinkService/src/main/resources/mapper/KwBoxMapper.xml
  6. +73
    -26
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml
  7. +1
    -1
      mallinkService/src/main/resources/mapper/KwMeterMapper.xml

+ 0
- 3
mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java Ver ficheiro

@@ -60,9 +60,6 @@ public class KwMerchantMeterController extends BaseController {
KwMerchantMeterVo kwMerchantMeterVo = kwMerchantMeterService.getById(id); KwMerchantMeterVo kwMerchantMeterVo = kwMerchantMeterService.getById(id);
if (kwMerchantMeterVo == null) if (kwMerchantMeterVo == null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
kwMerchantMeterVo.getMeterList().stream().forEach(m->{
m.setLatestRecord(kwMeterDataService.findLastRecord(m.getId()));
});
return new ResultData(kwMerchantMeterVo); return new ResultData(kwMerchantMeterVo);
} }




+ 2
- 2
mallinkService/src/main/java/com/iformall/domain/dto/KwMerchantMeterDto.java Ver ficheiro

@@ -21,10 +21,10 @@ public class KwMerchantMeterDto extends BaseEntity {
private String merchantName; private String merchantName;


@io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson")
private String linkPerson;
private String merchantLinkPerson;


@io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone") @io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone")
private String linkPhone;
private String merchantLinkPhone;


@io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId") @io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId")
private Integer businessId; private Integer businessId;


+ 2
- 1
mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java Ver ficheiro

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


import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -17,7 +18,7 @@ import java.util.List;
*/ */
@Table(name = "kw_meter") @Table(name = "kw_meter")
@Data @Data
@ToString(callSuper = true)
@JsonIgnoreProperties(value = {"handler"})
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class KwMeter extends BaseEntity { public class KwMeter extends BaseEntity {
@Id @Id


+ 0
- 1
mallinkService/src/main/java/com/iformall/mapper/KwMerchantMeterMapper.java Ver ficheiro

@@ -13,7 +13,6 @@ import java.util.List;
public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Long> { public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Long> {


List<KwMerchantMeterVo> findVoList(KwMerchantMeterDto param); List<KwMerchantMeterVo> findVoList(KwMerchantMeterDto param);

List<KwMerchantMeterDataVo> findDataVoList(KwMerchantMeterDataDto param); List<KwMerchantMeterDataVo> findDataVoList(KwMerchantMeterDataDto param);


KwMerchantMeterVo getById(@Param("merchantId")Long merchantId); KwMerchantMeterVo getById(@Param("merchantId")Long merchantId);


+ 1
- 1
mallinkService/src/main/resources/mapper/KwBoxMapper.xml Ver ficheiro

@@ -38,7 +38,7 @@
</if> </if>
<if test=" null != imei "> <if test=" null != imei ">
and `imei` = #{imei}
and `imei` like concat('%', #{imei},'%')
</if> </if>
<if test=" null != iccid "> <if test=" null != iccid ">


+ 73
- 26
mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml Ver ficheiro

@@ -10,7 +10,6 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>



</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
@@ -73,10 +72,22 @@
<result column="box_id" jdbcType="BIGINT" property="boxId"/> <result column="box_id" jdbcType="BIGINT" property="boxId"/>
<result column="status" jdbcType="INTEGER" property="status"/> <result column="status" jdbcType="INTEGER" property="status"/>
<result column="bind_status" jdbcType="INTEGER" property="bindStatus"/> <result column="bind_status" jdbcType="INTEGER" property="bindStatus"/>

<association column="{meterId=id}" property="latestRecord"
select="com.iformall.mapper.KwMeterDataMapper.findLastRecordList">
</association >

</resultMap> </resultMap>


<select id="findMeterList" parameterType="java.util.Map" resultMap="MeterBaseResultMap">
select m.* from kw_merchant_meter mm
<resultMap id="MeterSimpleResultMap" type="com.iformall.domain.po.KwMeter">
<id column="id" jdbcType="BIGINT" property="id"/>
<association column="{meterId=id}" property="latestRecord"
select="com.iformall.mapper.KwMeterDataMapper.findLastRecordList">
</association >
</resultMap>

<select id="findSimpleMeterList" parameterType="java.util.Map" resultMap="MeterSimpleResultMap">
select m.id from kw_merchant_meter mm
left join kw_meter m on mm.`meter_id` = m.id left join kw_meter m on mm.`meter_id` = m.id
where mm.`status` = 0 where mm.`status` = 0
<if test=" null != merchantId "> <if test=" null != merchantId ">
@@ -84,8 +95,16 @@
</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="BaseResultMapVo" 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"/>
<result column="status" jdbcType="INTEGER" property="status"/> <result column="status" jdbcType="INTEGER" property="status"/>
@@ -93,25 +112,22 @@
<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"/>


<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
<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"
select="com.iformall.mapper.KwMerchantMeterMapper.findMeterList">
select="com.iformall.mapper.KwMerchantMeterMapper.findSimpleMeterList">
</collection> </collection>

</resultMap> </resultMap>


<sql id="allColumnsVo"> <sql id="allColumnsVo">
`id`, `tenant_id`, `merchant_id`, `status`, `name`, `link_phone` `id`, `tenant_id`, `merchant_id`, `status`, `name`, `link_phone`
</sql> </sql>


<select id="findVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDto" resultMap="BaseResultMapVo">
<select id="findVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDto" resultMap="BaseResultMapListVo">
select <include refid="allColumnsVo"/> select <include refid="allColumnsVo"/>
from ( from (
select merchant_id from kw_merchant_meter select merchant_id from kw_merchant_meter
@@ -133,8 +149,8 @@
and `name` like concat('%', #{merchantName},'%') and `name` like concat('%', #{merchantName},'%')
</if> </if>


<if test=" null != linkPhone and ''!=linkPhone ">
and `link_phone` like concat('%', #{linkPhone},'%')
<if test=" null != merchantLinkPhone and ''!=merchantLinkPhone ">
and `link_phone` like concat('%', #{merchantLinkPhone},'%')
</if> </if>


<if test=" null != merchantStatus "> <if test=" null != merchantStatus ">
@@ -147,6 +163,49 @@


</select> </select>


<select id="findMeterList" parameterType="java.util.Map" resultMap="MeterBaseResultMap">
select m.* 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="BaseResultMapVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="status" jdbcType="INTEGER" property="status"/>

<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>

<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>

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

<select id="getById" parameterType="Long" resultMap="BaseResultMapVo">
select <include refid="allColumnsVo"/>
from (
select merchant_id from kw_merchant_meter
where `status` = 0
and `merchant_id` = #{merchantId}
group by merchant_id
) temp
, wx_merchant
where temp.merchant_id = id
</select>



<sql id="dynamicWhereConditionsVo"> <sql id="dynamicWhereConditionsVo">
where 1 = 1 where 1 = 1
@@ -240,18 +299,6 @@






<select id="getById" parameterType="java.lang.Long" resultMap="BaseResultMapVo">
select <include refid="allColumnsVo"/>
from (
select merchant_id from kw_merchant_meter
where `status` = 0
and `merchant_id` = #{merchantId}
group by merchant_id
) temp
, wx_merchant
where temp.merchant_id = id
</select>

<update id="unbindBatch" parameterType="java.lang.Long"> <update id="unbindBatch" parameterType="java.lang.Long">
update kw_merchant_meter set status = 1 update kw_merchant_meter set status = 1
where status = 0 where status = 0


+ 1
- 1
mallinkService/src/main/resources/mapper/KwMeterMapper.xml Ver ficheiro

@@ -36,7 +36,7 @@
</if> </if>
<if test=" null != address"> <if test=" null != address">
and `address` = #{address}
and `address` like concat('%', #{address},'%')
</if> </if>
<if test=" null != brand and '' != brand "> <if test=" null != brand and '' != brand ">


Carregando…
Cancelar
Guardar