接口联调优化

This commit is contained in:
mashuai 2024-12-02 11:15:28 +08:00
parent ebf09c985f
commit 16aa4dedd8
5 changed files with 46 additions and 17 deletions

View File

@ -54,7 +54,7 @@ public interface DevInfoMapper {
* @param companyId
* @return
*/
DevInfoVo getCompanyUpNum(String companyId);
int getCompanyUpNum(String companyId);
/**
* 查询设备信息列表
@ -158,5 +158,12 @@ public interface DevInfoMapper {
String selectTaskNumByMonth(@Param("date") Date nowDate);
Integer upMaStatus(DevInfoVo devInfoVo);
/**
* 查询企业信息
* @param companyId
* @return
*/
DevInfoVo selectCompanyById(String companyId);
}

View File

@ -100,8 +100,9 @@ public class DevInfoServiceImpl implements DevInfoService {
//根据设备id查询所属公司上架装备数以及公司访问量
if (StringUtils.isNotBlank(devInfoVo.getCompanyId())) {
int devNum = devInfoMapper.selectCompany(devInfoVo.getCompanyId());
DevInfoVo infoVo = devInfoMapper.getCompanyUpNum(devInfoVo.getCompanyId());
devInfoVo.setCompanyVisitNum(infoVo.getCompanyVisitNum());
int companyVisitNum = devInfoMapper.getCompanyUpNum(devInfoVo.getCompanyId());
DevInfoVo infoVo = devInfoMapper.selectCompanyById(devInfoVo.getCompanyId());
devInfoVo.setCompanyVisitNum(companyVisitNum);
devInfoVo.setCompanyCreateTime(infoVo.getCompanyCreateTime());
devInfoVo.setDevUapNum(devNum);
}

View File

@ -57,6 +57,18 @@ public class MaLeaseDto extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd")
private String finishEndTime;
/**
* 需求接单开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private String orderStartTime;
/**
* 需求接单结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private String orderEndTime;
private String orderUser;
}

View File

@ -656,26 +656,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
ma_order_details m
LEFT JOIN ma_order_info m1 ON m.order_id = m1.order_id
LEFT JOIN sys_user su ON m1.order_user = su.user_id
LEFT JOIN sys_user su ON m1.buyer_id = su.user_id
WHERE
m.ma_id = #{maId}
</select>
<select id="getCompanyUpNum" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
<select id="getCompanyUpNum" resultType="java.lang.Integer">
SELECT
SUM( h.search_num ) AS companyVisitNum,
c.create_time as companyCreateTime
IFNULL(SUM( h.search_num ), 0) AS companyVisitNum
FROM
ma_hot_search h
LEFT JOIN ma_dev_info m ON h.ma_id = m.ma_id
AND m.is_active = '1'
LEFT JOIN bm_company_info c ON m.own_co = c.company_id
WHERE
m.ma_status = '2'
AND m.own_co = #{companyId}
GROUP BY
m.own_co
</select>
<select id="selectTaskNumByMonth" resultType="java.lang.String">
SELECT SUBSTRING(code, - 4) as code
FROM ma_dev_info
@ -683,4 +680,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY create_time DESC LIMIT 1
</select>
<select id="selectCompanyById" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
select
company_id as companyId,
company_name as companyName,
create_time as companyCreateTime
from bm_company_info
where company_id = #{companyId}
</select>
</mapper>

View File

@ -203,10 +203,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="leaseStatus != null">
and m.lease_status = #{leaseStatus}
</if>
<if test="publishStartTime != null and publishEndTime != ''">
<if test="publishStartTime != null and publishStartTime != '' and publishEndTime != null and publishEndTime != ''">
and DATE_FORMAT(m.start_time,'%Y-%m-%d') between #{publishStartTime} and #{publishEndTime}
</if>
<if test="finishStartTime != null and finishEndTime != ''">
<if test="finishStartTime != null and finishStartTime != '' and finishEndTime != null and finishEndTime != ''">
and DATE_FORMAT(m.end_time,'%Y-%m-%d') between #{finishStartTime} and #{finishEndTime}
</if>
GROUP BY m.lease_code
@ -363,10 +363,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.description as description,
su.nick_name as publishUser,
su1.nick_name as orderUser,
m.order_time as orderTime
m.order_time as orderTime,
b.id as areaId,
b.name as areaName
FROM
ma_lease_info m
LEFT JOIN bm_company_info c ON m.company_id = c.company_id
LEFT JOIN base_address b ON b.id = m.area_id
LEFT JOIN sys_user su ON m.publish_user = su.user_id
LEFT JOIN sys_user su1 ON m.order_user = su1.user_id
WHERE 1 = 1 and m.order_user = #{orderUser} and m.lease_status = '1'
@ -376,12 +379,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="leaseName != null and leaseName != ''">
and m.lease_name like concat('%',#{leaseName},'%')
</if>
<if test="publishStartTime != null and publishEndTime != ''">
and DATE_FORMAT(m.start_time,'%Y-%m-%d') between #{publishStartTime} and #{publishEndTime}
</if>
<if test="finishStartTime != null and finishEndTime != ''">
<if test="finishStartTime != null and finishStartTime != '' and finishEndTime != null and finishEndTime != ''">
and DATE_FORMAT(m.end_time,'%Y-%m-%d') between #{finishStartTime} and #{finishEndTime}
</if>
<if test="orderStartTime != null and orderStartTime != '' and orderEndTime != null and orderEndTime != ''">
and DATE_FORMAT(m.order_time,'%Y-%m-%d') between #{orderStartTime} and #{orderEndTime}
</if>
GROUP BY m.lease_code
</select>
</mapper>