Commit bf0c48e9 authored by tangf's avatar tangf

新增公司消息

parent 3359a531
...@@ -38,6 +38,12 @@ public class DevideController { ...@@ -38,6 +38,12 @@ public class DevideController {
return deviceService.findDeviceInfo(req); return deviceService.findDeviceInfo(req);
} }
@RequestMapping(value = "/findDeviceInfoByCode", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<DeviceResVo> findDeviceInfoByCode(@RequestBody DeviceReqVo req){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
return deviceService.findDeviceInfoByCode(req);
}
@RequestMapping(value = "/saveDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/saveDevice", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveDevice(@RequestBody DeviceReqVo req){ public ResponseResult saveDevice(@RequestBody DeviceReqVo req){
// CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException(); // CheckerHelper.newInstance().notBlankCheck("id",req.getId()).checkException();
......
...@@ -9,5 +9,7 @@ public interface DeviceDao extends BaseDao { ...@@ -9,5 +9,7 @@ public interface DeviceDao extends BaseDao {
PageSizeData<DeviceResVo> findDevicePage(DeviceReqVo req); PageSizeData<DeviceResVo> findDevicePage(DeviceReqVo req);
DeviceResVo findDeviceInfo(DeviceReqVo req);
} }
...@@ -17,6 +17,8 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao { ...@@ -17,6 +17,8 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao {
private static final String QUERY_LIST = "QUERY_LIST"; private static final String QUERY_LIST = "QUERY_LIST";
private static final String QUERY_INFO = "QUERY_INFO";
@Override @Override
protected void init() { protected void init() {
register(DeviceVo.class); register(DeviceVo.class);
...@@ -30,6 +32,17 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao { ...@@ -30,6 +32,17 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao {
.add("merchantId", " AND merchant_id = ? ") .add("merchantId", " AND merchant_id = ? ")
.add("deviceStatus", " AND device_status = ? "); .add("deviceStatus", " AND device_status = ? ");
table.add(QUERY_INFO, "SELECT a.*,b.company_name FROM pd_device a LEFT JOIN pd_company b ON a.company_id = b.id WHERE 1=1 {WHERE")
.add("deviceId", "AND device_id = ? ")
.add("deviceCode", "AND device_code = ? ")
.add("deviceName", " AND device_name = ? ")
.add("deviceType", " AND device_type = ? ")
.add("companyId", " AND company_id = ? ")
.add("channelId", " AND channel_id = ? ")
.add("merchantId", " AND merchant_id = ? ")
.add("deviceStatus", " AND device_status = ? ");
;
} }
@Override @Override
...@@ -37,4 +50,9 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao { ...@@ -37,4 +50,9 @@ public class DeviceDaoImpl extends BaseDaoImpl implements DeviceDao {
return queryPage(DeviceResVo.class, req, QUERY_LIST, req); return queryPage(DeviceResVo.class, req, QUERY_LIST, req);
} }
@Override
public DeviceResVo findDeviceInfo(DeviceReqVo req) {
return queryFirst(DeviceResVo.class, QUERY_INFO, req);
}
} }
...@@ -12,6 +12,8 @@ public interface DeviceService { ...@@ -12,6 +12,8 @@ public interface DeviceService {
ResponseResult<DeviceResVo> findDeviceInfo( DeviceReqVo req); ResponseResult<DeviceResVo> findDeviceInfo( DeviceReqVo req);
ResponseResult<DeviceResVo> findDeviceInfoByCode(DeviceReqVo req);
ResponseResult saveDevice(DeviceReqVo req); ResponseResult saveDevice(DeviceReqVo req);
ResponseResult<DeviceVo> updateDevice(DeviceReqVo req); ResponseResult<DeviceVo> updateDevice(DeviceReqVo req);
......
...@@ -30,6 +30,11 @@ public class DeviceServiceImpl implements DeviceService { ...@@ -30,6 +30,11 @@ public class DeviceServiceImpl implements DeviceService {
return ResponseResult.result(deviceResVo); return ResponseResult.result(deviceResVo);
} }
public ResponseResult<DeviceResVo> findDeviceInfoByCode(DeviceReqVo req) {
DeviceResVo deviceResVo = deviceDao.findDeviceInfo(req);
return ResponseResult.result(deviceResVo);
}
@Override @Override
public ResponseResult saveDevice(DeviceReqVo req) { public ResponseResult saveDevice(DeviceReqVo req) {
return ResponseResult.result(null); return ResponseResult.result(null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment