Commit 65176fdd by wnb0128

车家智能数据服务开发 场景指令条件开发--think.wang

1 parent a5f2b0bd
...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* @Title: IndexController.java * @Title: ConditionController.java
* @Description:获取场景指令触发条件 * @Description:获取场景指令触发条件
* @author think.wang * @author think.wang
* @version V1.0 * @version V1.0
......
...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* @Title: IndexController.java * @Title: ContentController.java
* @Description:获取场景指令执行内容 * @Description:获取场景指令执行内容
* @author think.wang * @author think.wang
* @version V1.0 * @version V1.0
......
package com.glsx.smart.controller;
import com.alibaba.fastjson.JSON;
import com.glsx.smart.dao.entity.SmartDeviceOrdervalue;
import com.glsx.smart.service.SmartDeviceOrdervalueService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Title: OrderValueController.java
* @Description:获取场景指令值列表
* @author think.wang
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
@RestController
@RequestMapping("/orderValue")
public class OrderValueController {
@Autowired
private SmartDeviceOrdervalueService ordervalueService;
@ResponseBody
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartDeviceOrdervalue> getList(@RequestBody SmartDeviceOrdervalue record){
log.info("请求参数:{}", JSON.toJSONString(record));
return ordervalueService.getList(record);
}
}
package com.glsx.smart.controller; package com.glsx.smart.controller;
import java.util.List;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartDeviceOrder; import com.glsx.smart.dao.entity.SmartDeviceOrder;
...@@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* <p>Description: 产品列表业务 * <p>Description: 产品列表业务
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -40,6 +41,18 @@ public class ProductController { ...@@ -40,6 +41,18 @@ public class ProductController {
} }
/** /**
* 获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/getListByCondition", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartProduct> getListByCondition(@RequestBody SmartProduct req) {
log.info("/product/getListByCondition param: {}", JSON.toJSONString(req));
return productService.getListByCondition(req);
}
/**
* 根据 id 查询产品详情。 * 根据 id 查询产品详情。
* *
* @param id 产品 id * @param id 产品 id
......
...@@ -3,6 +3,8 @@ package com.glsx.smart.dao.mapper; ...@@ -3,6 +3,8 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartDeviceOrdervalue; import com.glsx.smart.dao.entity.SmartDeviceOrdervalue;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -14,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface SmartDeviceOrdervalueMapper public interface SmartDeviceOrdervalueMapper
extends tk.mybatis.mapper.common.Mapper<SmartDeviceOrdervalue> { extends tk.mybatis.mapper.common.Mapper<SmartDeviceOrdervalue> {
List<SmartDeviceOrdervalue> getList(SmartDeviceOrdervalue record);
} }
package com.glsx.smart.dao.mapper; package com.glsx.smart.dao.mapper;
import java.util.List;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -14,8 +15,11 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,8 +15,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface SmartProductMapper extends tk.mybatis.mapper.common.Mapper<SmartProduct> { public interface SmartProductMapper extends tk.mybatis.mapper.common.Mapper<SmartProduct> {
List<SmartProduct> getList(SmartProduct product); List<SmartProduct> getList(SmartProduct product);
List<SmartProduct> getByCondition(SmartProduct product);
SmartProduct getById(Long id); SmartProduct getById(Long id);
int countByProductName(String productName); int countByProductName(String productName);
......
package com.glsx.smart.service; package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartDeviceOrdervalue;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -10,5 +14,6 @@ package com.glsx.smart.service; ...@@ -10,5 +14,6 @@ package com.glsx.smart.service;
public interface SmartDeviceOrdervalueService { public interface SmartDeviceOrdervalueService {
List<SmartDeviceOrdervalue> getList(SmartDeviceOrdervalue record);
} }
package com.glsx.smart.service; package com.glsx.smart.service;
import java.util.List;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartDeviceOrder; import com.glsx.smart.dao.entity.SmartDeviceOrder;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -14,8 +15,11 @@ import com.glsx.smart.dao.entity.SmartProduct; ...@@ -14,8 +15,11 @@ import com.glsx.smart.dao.entity.SmartProduct;
*/ */
public interface SmartProductService { public interface SmartProductService {
PageInfo<SmartProduct> getList(SmartProduct product); PageInfo<SmartProduct> getList(SmartProduct product);
List<SmartProduct> getListByCondition(SmartProduct product);
SmartProduct getById(Long id); SmartProduct getById(Long id);
Boolean save(SmartProduct product); Boolean save(SmartProduct product);
......
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import javax.annotation.Resource; import com.glsx.smart.dao.entity.SmartDeviceOrdervalue;
import com.glsx.smart.dao.mapper.SmartDeviceOrdervalueMapper; import com.glsx.smart.dao.mapper.SmartDeviceOrdervalueMapper;
import com.glsx.smart.service.SmartDeviceOrdervalueService; import com.glsx.smart.service.SmartDeviceOrdervalueService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* <p>Description: * <p>Description:
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -17,6 +20,10 @@ import org.springframework.stereotype.Service; ...@@ -17,6 +20,10 @@ import org.springframework.stereotype.Service;
public class SmartDeviceOrdervalueServiceImpl implements SmartDeviceOrdervalueService { public class SmartDeviceOrdervalueServiceImpl implements SmartDeviceOrdervalueService {
@Resource @Resource
private SmartDeviceOrdervalueMapper smartDeviceOrdervalueMapper; private SmartDeviceOrdervalueMapper ordervalueMapper;
@Override
public List<SmartDeviceOrdervalue> getList(SmartDeviceOrdervalue record) {
return ordervalueMapper.getList(record);
}
} }
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartDeviceOrder; import com.glsx.smart.dao.entity.SmartDeviceOrder;
...@@ -18,6 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/** /**
* <p>Description: 产品列表业务 * <p>Description: 产品列表业务
* <p>Project: chejia-smart * <p>Project: chejia-smart
...@@ -48,6 +49,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct ...@@ -48,6 +49,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
return pageInfo; return pageInfo;
} }
@Override
public List<SmartProduct> getListByCondition(SmartProduct product) {
return productMapper.getByCondition(product);
}
/** /**
* 根据 id 查询产品详情。 * 根据 id 查询产品详情。
* *
......
...@@ -13,4 +13,12 @@ ...@@ -13,4 +13,12 @@
<!--@mbg.generated generated on Fri Mar 19 17:22:28 CST 2021.--> <!--@mbg.generated generated on Fri Mar 19 17:22:28 CST 2021.-->
id, order_id, device_status_code, device_status_value id, order_id, device_status_code, device_status_value
</sql> </sql>
<select id="getList" parameterType="com.glsx.smart.dao.entity.SmartDeviceOrdervalue" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from smart_device_ordervalue
<where>
<if test="orderId != null">
and order_id = #{orderId,jdbcType=INTEGER}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -43,6 +43,18 @@ ...@@ -43,6 +43,18 @@
order by sp.create_time desc order by sp.create_time desc
</select> </select>
<select id="getByCondition" parameterType="com.glsx.smart.dao.entity.SmartProduct" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from smart_product
<where>
<if test="platformProductId != null and platformProductId != ''" >
and platform_product_id = #{platformProductId,jdbcType=VARCHAR}
</if>
<if test="status != null">
and `status` = #{status,jdbcType=TINYINT}
</if>
</where>
</select>
<select id="getById" resultMap="BaseResultMap"> <select id="getById" resultMap="BaseResultMap">
select sp.id, sp.product_name, sp.icon, sp.type_id, sp.shop_product_id, sp.platform_key, select sp.id, sp.product_name, sp.icon, sp.type_id, sp.shop_product_id, sp.platform_key,
sp.platform_product_id, sp.network_key, sp.status, sp.remark, sp.create_time, sp.platform_product_id, sp.network_key, sp.status, sp.remark, sp.create_time,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!