首页装备搜索
This commit is contained in:
parent
11c9f3a423
commit
2be1e0098d
|
|
@ -75,6 +75,12 @@ public class DevInfoVo extends DevInfo {
|
||||||
@ApiModelProperty(value = "搜索月租金最大值")
|
@ApiModelProperty(value = "搜索月租金最大值")
|
||||||
private Integer monthLeasePriceMax;
|
private Integer monthLeasePriceMax;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "搜索天租金最下值")
|
||||||
|
private Integer dayLeasePriceMin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "搜索填租金最大值")
|
||||||
|
private Integer dayLeasePriceMax;
|
||||||
|
|
||||||
@ApiModelProperty(value = "搜索装备年份最小值")
|
@ApiModelProperty(value = "搜索装备年份最小值")
|
||||||
private Integer ageMin;
|
private Integer ageMin;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ package com.bonus.material.home.controller;
|
||||||
|
|
||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import com.bonus.material.home.service.MaTypeInfoSevice;
|
import com.bonus.material.home.service.MaTypeInfoSevice;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
@ -36,4 +38,11 @@ public class MaTypeInfoController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("首页搜索热搜装备")
|
||||||
|
@GetMapping("/getHotSearch")
|
||||||
|
public AjaxResult getHotSearch(DevInfoVo devInfoVo) {
|
||||||
|
List<DevInfoVo> list = maTypeInfoSevice.getHotSearch(devInfoVo);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.home.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.bonus.common.biz.domain.TypeInfo;
|
import com.bonus.common.biz.domain.TypeInfo;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -17,4 +18,10 @@ public interface MaTypeInfoMapper {
|
||||||
*/
|
*/
|
||||||
public List<TypeInfo> getMaTypeInfoList() ;
|
public List<TypeInfo> getMaTypeInfoList() ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 热搜设备
|
||||||
|
* @param devInfoVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DevInfoVo> getHotSearch(DevInfoVo devInfoVo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.home.service;
|
package com.bonus.material.home.service;
|
||||||
|
|
||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -15,4 +16,10 @@ public interface MaTypeInfoSevice {
|
||||||
*/
|
*/
|
||||||
public List<Tree<Long>> getMaTypeInfoList();
|
public List<Tree<Long>> getMaTypeInfoList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页搜索热搜装备
|
||||||
|
* @param devInfoVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DevInfoVo> getHotSearch(DevInfoVo devInfoVo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.lang.tree.Tree;
|
||||||
import cn.hutool.core.lang.tree.TreeNode;
|
import cn.hutool.core.lang.tree.TreeNode;
|
||||||
import cn.hutool.core.lang.tree.TreeUtil;
|
import cn.hutool.core.lang.tree.TreeUtil;
|
||||||
import com.bonus.common.biz.domain.TypeInfo;
|
import com.bonus.common.biz.domain.TypeInfo;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import com.bonus.material.home.mapper.MaTypeInfoMapper;
|
import com.bonus.material.home.mapper.MaTypeInfoMapper;
|
||||||
import com.bonus.material.home.service.MaTypeInfoSevice;
|
import com.bonus.material.home.service.MaTypeInfoSevice;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -31,6 +32,16 @@ public class MaTypeInfoServiceImpl implements MaTypeInfoSevice {
|
||||||
return TreeUtil.build(collect,0L);
|
return TreeUtil.build(collect,0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页搜索热搜装备
|
||||||
|
* @param devInfoVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DevInfoVo> getHotSearch(DevInfoVo devInfoVo) {
|
||||||
|
return maTypeInfoMapper.getHotSearch(devInfoVo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取节点转换函数方法抽取
|
* 获取节点转换函数方法抽取
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -48,22 +48,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
|
|
||||||
<select id="selectDevInfoList" parameterType="com.bonus.material.device.domain.vo.DevInfoVo" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
<select id="selectDevInfoList" parameterType="com.bonus.material.device.domain.vo.DevInfoVo" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||||
select d.*,mt1.type_name as device_name, mt2.type_name as group_name, mt3.type_name as type_name,c.company_name
|
SELECT
|
||||||
from ma_dev_info d
|
d.ma_id as maId,
|
||||||
left join ma_type mt1 on d.type_id = mt1.type_id
|
d.code as code,
|
||||||
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
d.device_name as deviceName,
|
||||||
left join ma_type mt3 on mt2.parent_id = mt3.type_id
|
d.device_weight as deviceWeight,
|
||||||
left join bm_company_info c on d.own_co = c.company_id
|
d.type_id as typeId,
|
||||||
|
mt4.type_name as typeName,
|
||||||
|
d.ma_status as maStatus,
|
||||||
|
d.brand as brand,
|
||||||
|
d.model_name as modelName,
|
||||||
|
d.production_date as productionDate,
|
||||||
|
d.working_hours as workingHours,
|
||||||
|
d.serial_number as serialNumber,
|
||||||
|
d.month_lease_price as monthLeasePrice,
|
||||||
|
d.day_lease_price as dayLeasePrice,
|
||||||
|
d.person as person,
|
||||||
|
d.person_phone as personPhone,
|
||||||
|
c.company_name as companyName,
|
||||||
|
c.operate_address as operateAddress,
|
||||||
|
mt3.type_id as thirdId,
|
||||||
|
mt3.type_name as thirdName,
|
||||||
|
mt2.type_id as secondId,
|
||||||
|
mt2.type_name as secondName,
|
||||||
|
mt1.type_id as firstId,
|
||||||
|
mt1.type_name as firstName
|
||||||
|
FROM
|
||||||
|
ma_dev_info d
|
||||||
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||||
|
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id and mt4.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id and mt3.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt3.parent_id and mt2.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id and mt1.del_flag = '0'
|
||||||
<where>
|
<where>
|
||||||
<if test="maId != null "> and d.ma_id = #{maId}</if>
|
<if test="maId != null "> and d.ma_id = #{maId}</if>
|
||||||
<if test="code != null and code != ''"> and d.code = #{code}</if>
|
<if test="code != null and code != ''"> and d.code = #{code}</if>
|
||||||
|
<if test="deviceName != null and deviceName != ''">
|
||||||
|
and d.device_name like concat('%',#{deviceName},'%')
|
||||||
|
</if>
|
||||||
<if test="typeId != null">
|
<if test="typeId != null">
|
||||||
<if test="level != null and level == 2">
|
and d.type_id = #{typeId}
|
||||||
and t.parent_id = #{typeId}
|
</if>
|
||||||
</if>
|
<if test="thirdId != null">
|
||||||
<if test="level != null and level == 3">
|
and mt3.type_id = #{thirdId}
|
||||||
and d.type_id = #{typeId}
|
</if>
|
||||||
</if>
|
<if test="secondId != null">
|
||||||
|
and mt2.type_id = #{secondId}
|
||||||
|
</if>
|
||||||
|
<if test="firstId != null">
|
||||||
|
and mt1.type_id = #{firstId}
|
||||||
</if>
|
</if>
|
||||||
<if test="maStatus != null and maStatus != ''"> and d.ma_status = #{maStatus}</if>
|
<if test="maStatus != null and maStatus != ''"> and d.ma_status = #{maStatus}</if>
|
||||||
<if test="leaseScope != null "> and d.lease_scope = #{leaseScope}</if>
|
<if test="leaseScope != null "> and d.lease_scope = #{leaseScope}</if>
|
||||||
|
|
@ -81,21 +114,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and d.working_hours >= #{workingHoursMin} and d.working_hours <= #{workingHoursMax}
|
and d.working_hours >= #{workingHoursMin} and d.working_hours <= #{workingHoursMax}
|
||||||
</if>
|
</if>
|
||||||
<if test="serialNumber != null and serialNumber != ''"> and d.serial_number = #{serialNumber}</if>
|
<if test="serialNumber != null and serialNumber != ''"> and d.serial_number = #{serialNumber}</if>
|
||||||
<if test="monthLeasePriceMin != null and monthLeasePriceMax != null">
|
<!--<if test="monthLeasePriceMin != null and monthLeasePriceMax != null">
|
||||||
and d.month_lease_price >= #{monthLeasePriceMin} and d.month_lease_price <= #{monthLeasePriceMax}
|
and d.month_lease_price >= #{monthLeasePriceMin} and d.month_lease_price <= #{monthLeasePriceMax}
|
||||||
|
</if>-->
|
||||||
|
<if test="dayLeasePriceMin != null and dayLeasePriceMax != null">
|
||||||
|
and d.day_lease_price >= #{dayLeasePriceMin} and d.day_lease_price <= #{dayLeasePriceMax}
|
||||||
</if>
|
</if>
|
||||||
<if test="dayLeasePrice != null and dayLeasePrice != ''"> and d.day_lease_price = #{dayLeasePrice}</if>
|
|
||||||
<if test="picUrl != null and picUrl != ''"> and d.pic_url = #{picUrl}</if>
|
|
||||||
<if test="jsMonthPrice != null and jsMonthPrice != ''"> and d.js_month_price = #{jsMonthPrice}</if>
|
<if test="jsMonthPrice != null and jsMonthPrice != ''"> and d.js_month_price = #{jsMonthPrice}</if>
|
||||||
<if test="jsDayPrice != null and jsDayPrice != ''"> and d.js_day_price = #{jsDayPrice}</if>
|
<if test="jsDayPrice != null and jsDayPrice != ''"> and d.js_day_price = #{jsDayPrice}</if>
|
||||||
<if test="description != null and description != ''"> and d.description = #{description}</if>
|
<if test="description != null and description != ''"> and d.description = #{description}</if>
|
||||||
<if test="gpsCode != null and gpsCode != ''"> and d.gps_code = #{gpsCode}</if>
|
<if test="gpsCode != null and gpsCode != ''"> and d.gps_code = #{gpsCode}</if>
|
||||||
<if test="companyId != null "> and d.own_co = #{companyId}</if>
|
<if test="companyId != null "> and d.own_co = #{companyId}</if>
|
||||||
<if test="creator != null "> and d.creator = #{creator}</if>
|
|
||||||
<if test="updateBy != null "> and d.update_by = #{updateBy}</if>
|
|
||||||
<if test="specification != null "> and d.specification = #{specification}</if>
|
<if test="specification != null "> and d.specification = #{specification}</if>
|
||||||
<if test="deposit != null "> and d.deposit = #{deposit}</if>
|
<if test="deposit != null "> and d.deposit = #{deposit}</if>
|
||||||
<if test="isActive != null and isActive != ''"> and d.is_active = #{isActive}</if>
|
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (
|
and (
|
||||||
locate(#{keyWord},mt1.type_name) > 0
|
locate(#{keyWord},mt1.type_name) > 0
|
||||||
|
|
@ -145,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
d.person as person,
|
d.person as person,
|
||||||
d.person_phone as personPhone,
|
d.person_phone as personPhone,
|
||||||
c.company_name as companyName,
|
c.company_name as companyName,
|
||||||
|
c.operate_address as operateAddress,
|
||||||
d.create_time as createTime
|
d.create_time as createTime
|
||||||
FROM
|
FROM
|
||||||
ma_dev_info d
|
ma_dev_info d
|
||||||
|
|
@ -398,12 +430,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCompanyList" resultType="com.bonus.common.biz.domain.BmCompanyInfo">
|
<select id="selectCompanyList" resultType="com.bonus.common.biz.domain.BmCompanyInfo">
|
||||||
select company_id as companyId,
|
select
|
||||||
|
company_id as companyId,
|
||||||
company_name as companyName,
|
company_name as companyName,
|
||||||
register_address as registerAddress,
|
register_address as registerAddress,
|
||||||
operate_address as operateAddress
|
operate_address as operateAddress
|
||||||
from bm_company_info
|
from bm_company_info
|
||||||
<where>
|
<where>
|
||||||
|
<if test="companyId != null">
|
||||||
|
and company_id = #{companyId}
|
||||||
|
</if>
|
||||||
<if test="companyName != null and companyName != ''">
|
<if test="companyName != null and companyName != ''">
|
||||||
and company_name like concat('%',#{companyName},'%')
|
and company_name like concat('%',#{companyName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from ma_type
|
from ma_type
|
||||||
where del_flag = '0'
|
where del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getHotSearch" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||||
|
SELECT
|
||||||
|
d.ma_id as maId,
|
||||||
|
d.code as code,
|
||||||
|
d.device_name as deviceName,
|
||||||
|
d.device_weight as deviceWeight,
|
||||||
|
d.type_id as typeId,
|
||||||
|
d.ma_status as maStatus,
|
||||||
|
d.brand as brand,
|
||||||
|
d.model_name as modelName,
|
||||||
|
d.production_date as productionDate,
|
||||||
|
d.working_hours as workingHours,
|
||||||
|
d.serial_number as serialNumber,
|
||||||
|
d.month_lease_price as monthLeasePrice,
|
||||||
|
d.day_lease_price as dayLeasePrice,
|
||||||
|
d.person as person,
|
||||||
|
d.person_phone as personPhone,
|
||||||
|
c.company_name as companyName,
|
||||||
|
c.operate_address as operateAddress,
|
||||||
|
d.create_time as createTime,
|
||||||
|
h.search_num as searchNum
|
||||||
|
FROM
|
||||||
|
ma_hot_search h
|
||||||
|
LEFT JOIN ma_dev_info d on d.ma_id = h.ma_id
|
||||||
|
LEFT JOIN bm_company_info c ON d.own_co = c.company_id
|
||||||
|
where
|
||||||
|
d.is_active='1'
|
||||||
|
and d.ma_status = '2'
|
||||||
|
<if test="deviceName != null and deviceName != ''">
|
||||||
|
and d.device_name = #{deviceName}
|
||||||
|
</if>
|
||||||
|
ORDER BY h.search_num DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue