Commit 2e469a06 authored by zhangsen's avatar zhangsen

API

parent 5f37cd0c
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<select id="getPersonYardByPage" resultType="java.util.Map"> <select id="getPersonYardByPage" resultType="java.util.Map">
SELECT SELECT
ifnull(b.name, '') as personName , ifnull(b.name, '') as objectName ,
ifnull(a.qrcode_color, '') AS qrCodeColor, ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(c.station_name, '') AS stationName ifnull(c.station_name, '') AS stationName
FROM FROM
......
...@@ -2,13 +2,16 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,13 +2,16 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum;
import com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign; import com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationQrCodeStatisticsMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -20,6 +23,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -20,6 +23,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -40,16 +44,34 @@ public class PersonQrCodeController extends BaseController { ...@@ -40,16 +44,34 @@ public class PersonQrCodeController extends BaseController {
@Autowired @Autowired
private StationQrCodeStatisticsMapper stationQrCodeStatisticsMapper; private StationQrCodeStatisticsMapper stationQrCodeStatisticsMapper;
@Autowired
private SjglZsjZsbtzMapper sjglZsjZsbtzMapper;
/** /**
* 评估大屏 - 人员赋码环形图查询 * 评估大屏 - 人员赋码环形图查询
* *
* @param parentCode 父级code * @param parentCode 父级code
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getPersonYardStatistics") @GetMapping(value = "/getPersonYardStatistics")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码环形图查询", notes = "评估大屏 - 人员赋码环形图查询") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码环形图查询", notes = "评估大屏 - 人员赋码环形图查询")
public ResponseModel<List<Map<String, Object>>> getPersonYardStatistics(@RequestParam(required = false, value = "parentCode") String parentCode) { public ResponseModel<List<Map<String, Object>>> getPersonYardStatistics(@RequestParam(required = false, value = "parentCode") String parentCode,
List<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardStatistics(parentCode); @RequestParam(required = false, value = "dataType") String dataType) {
List<Map<String, Object>> resultList = new ArrayList<>();
if (StringUtils.isNotEmpty(dataType) && dataType.equals("person")) {
resultList = personBasicMapper.getPersonYardStatistics(parentCode);
} else if (StringUtils.isNotEmpty(dataType) && dataType.equals("equip")) {
resultList = sjglZsjZsbtzMapper.getEquipYardStatistics(parentCode);
} else if (StringUtils.isNotEmpty(dataType) && dataType.equals("job")) {
resultList = sjglZsjZsbtzMapper.getJobYardStatistics(parentCode);
}
resultList.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name);
item.put("value", Integer.parseInt(item.get("value").toString()));
});
return ResponseHelper.buildResponse(resultList); return ResponseHelper.buildResponse(resultList);
} }
...@@ -58,13 +80,40 @@ public class PersonQrCodeController extends BaseController { ...@@ -58,13 +80,40 @@ public class PersonQrCodeController extends BaseController {
* *
* @param parentCode 父级code * @param parentCode 父级code
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getPersonYardByPage") @GetMapping(value = "/getPersonYardByPage")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码列表查询", notes = "评估大屏 - 人员赋码列表查询") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码列表查询", notes = "评估大屏 - 人员赋码列表查询")
public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode, public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(value = "current") Integer current, @RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size) { @RequestParam(value = "size") Integer size,
Page<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size); @RequestParam(required = false, value = "dataType") String dataType) {
Page<Map<String, Object>> resultList = new Page<>();
if ("person".equals(dataType)) {
resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size);
} else if ("equip".equals(dataType)) {
List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode);
Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode);
equipYardByPage.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name);
});
resultList.setRecords(equipYardByPage);
resultList.setCurrent(current);
resultList.setSize(size);
resultList.setTotal(equipYardByPageCount);
} else if ("job".equals(dataType)) {
List<Map<String, Object>> jobYardByPage = sjglZsjZsbtzMapper.getJobYardByPage((current - 1) * size, size, parentCode);
Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode);
jobYardByPage.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name);
});
resultList.setRecords(jobYardByPage);
resultList.setCurrent(current);
resultList.setSize(size);
resultList.setTotal(jobYardByPageCount);
}
return ResponseHelper.buildResponse(resultList); return ResponseHelper.buildResponse(resultList);
} }
...@@ -73,10 +122,11 @@ public class PersonQrCodeController extends BaseController { ...@@ -73,10 +122,11 @@ public class PersonQrCodeController extends BaseController {
* *
* @param parentCode 父级code * @param parentCode 父级code
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getQrCodeCount") @GetMapping(value = "/getQrCodeCount")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码数量等统计", notes = "评估大屏 - 人员赋码数量等统计") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码数量等统计", notes = "评估大屏 - 人员赋码数量等统计")
public ResponseModel<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode) { public ResponseModel<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(required = false, value = "dataType") String dataType) {
FeignClientResult<Map<String, Object>> sevenEntity = null; FeignClientResult<Map<String, Object>> sevenEntity = null;
try { try {
...@@ -107,7 +157,7 @@ public class PersonQrCodeController extends BaseController { ...@@ -107,7 +157,7 @@ public class PersonQrCodeController extends BaseController {
* @param parentCode 父级code * @param parentCode 父级code
* @param dataType 类型 - 人员、任务、设备等 * @param dataType 类型 - 人员、任务、设备等
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getQrCodeCountByStation") @GetMapping(value = "/getQrCodeCountByStation")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】")
public ResponseModel<List<Map<String, Object>>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode, public ResponseModel<List<Map<String, Object>>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode,
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz; import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -37,4 +38,41 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> { ...@@ -37,4 +38,41 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
* 任务赋码数据 * 任务赋码数据
*/ */
List<StationQrCodeStatistics> getTaskQrcodeInfo(); List<StationQrCodeStatistics> getTaskQrcodeInfo();
/**
* 设备赋码数据
*/
List<Map<String, Object>> getEquipYardStatistics(@Param("parentCode") String parentCode);
/**
* 任务赋码数据
*/
List<Map<String, Object>> getJobYardStatistics(@Param("parentCode") String parentCode);
/**
* 设备赋码列表
*/
List<Map<String, Object>> getEquipYardByPage(@Param("current") Integer current,
@Param("size") Integer size,
@Param("parentCode") String parentCode);
/**
* 设备赋码列表
*/
Integer getEquipYardByPageCount(@Param("parentCode") String parentCode);
/**
* 任务赋码列表
*/
List<Map<String, Object>> getJobYardByPage(@Param("current") Integer current,
@Param("size") Integer size,
@Param("parentCode") String parentCode);
/**
* 任务赋码列表数量统计
*/
Integer getJobYardByPageCount(@Param("parentCode") String parentCode);
} }
...@@ -195,93 +195,93 @@ public class PersonBasicController extends BaseController { ...@@ -195,93 +195,93 @@ public class PersonBasicController extends BaseController {
return response; return response;
} }
/** // /**
* 评估大屏 - 人员赋码环形图查询 // * 评估大屏 - 人员赋码环形图查询
* // *
* @param parentCode 父级code // * @param parentCode 父级code
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY) // @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPersonYardStatistics") // @GetMapping(value = "/getPersonYardStatistics")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码环形图查询", notes = "评估大屏 - 人员赋码环形图查询") // @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码环形图查询", notes = "评估大屏 - 人员赋码环形图查询")
public ResponseModel<List<Map<String, Object>>> getPersonYardStatistics(@RequestParam(required = false, value = "parentCode") String parentCode) { // public ResponseModel<List<Map<String, Object>>> getPersonYardStatistics(@RequestParam(required = false, value = "parentCode") String parentCode) {
List<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardStatistics(parentCode); // List<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardStatistics(parentCode);
return ResponseHelper.buildResponse(resultList); // return ResponseHelper.buildResponse(resultList);
} // }
/** // /**
* 评估大屏 - 人员赋码列表查询 // * 评估大屏 - 人员赋码列表查询
* // *
* @param parentCode 父级code // * @param parentCode 父级code
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY) // @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPersonYardByPage") // @GetMapping(value = "/getPersonYardByPage")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码列表查询", notes = "评估大屏 - 人员赋码列表查询") // @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码列表查询", notes = "评估大屏 - 人员赋码列表查询")
public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode, // public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(value = "current") Integer current, // @RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size) { // @RequestParam(value = "size") Integer size) {
Page<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size); // Page<Map<String, Object>> resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size);
return ResponseHelper.buildResponse(resultList); // return ResponseHelper.buildResponse(resultList);
} // }
//
/** // /**
* 评估大屏 - 人员赋码数量等统计 // * 评估大屏 - 人员赋码数量等统计
* // *
* @param parentCode 父级code // * @param parentCode 父级code
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY) // @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getQrCodeCount") // @GetMapping(value = "/getQrCodeCount")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码数量等统计", notes = "评估大屏 - 人员赋码数量等统计") // @ApiOperation(httpMethod = "GET", value = "评估大屏 - 人员赋码数量等统计", notes = "评估大屏 - 人员赋码数量等统计")
public ResponseModel<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode) { // public ResponseModel<Map<String, Object>> getQrCodeCount(@RequestParam(required = false, value = "parentCode") String parentCode) {
//
FeignClientResult<Map<String, Object>> sevenEntity = null; // FeignClientResult<Map<String, Object>> sevenEntity = null;
try { // try {
sevenEntity = mcbWarningFeign.getQrCodeCount(parentCode, "RYFM"); // sevenEntity = mcbWarningFeign.getQrCodeCount(parentCode, "RYFM");
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
if (sevenEntity != null && 200 == sevenEntity.getStatus()) { // if (sevenEntity != null && 200 == sevenEntity.getStatus()) {
Map<String, Object> result = sevenEntity.getResult(); // Map<String, Object> result = sevenEntity.getResult();
String red = result.get("red").toString(); // String red = result.get("red").toString();
String yellow = result.get("yellow").toString(); // String yellow = result.get("yellow").toString();
String redToGreen = result.get("redToGreen").toString(); // String redToGreen = result.get("redToGreen").toString();
String yellowToGreen = result.get("yellowToGreen").toString(); // String yellowToGreen = result.get("yellowToGreen").toString();
Integer countAll = personBasicMapper.getPersonYardByPageCount(parentCode); // Integer countAll = personBasicMapper.getPersonYardByPageCount(parentCode);
result.put("redToGreenPercent", getPercent(new BigDecimal(red), new BigDecimal(countAll))); // result.put("redToGreenPercent", getPercent(new BigDecimal(red), new BigDecimal(countAll)));
result.put("redPercent", getPercent(new BigDecimal(redToGreen), new BigDecimal(countAll))); // result.put("redPercent", getPercent(new BigDecimal(redToGreen), new BigDecimal(countAll)));
result.put("yellowToGreenPercent", getPercent(new BigDecimal(yellow), new BigDecimal(countAll))); // result.put("yellowToGreenPercent", getPercent(new BigDecimal(yellow), new BigDecimal(countAll)));
result.put("yellowPercent", getPercent(new BigDecimal(yellowToGreen), new BigDecimal(countAll))); // result.put("yellowPercent", getPercent(new BigDecimal(yellowToGreen), new BigDecimal(countAll)));
return ResponseHelper.buildResponse(result); // return ResponseHelper.buildResponse(result);
} // }
return ResponseHelper.buildResponse(null); // return ResponseHelper.buildResponse(null);
} // }
//
//
/** // /**
* 评估大屏 - 场站 人员赋码数量等统计 【折线图】 // * 评估大屏 - 场站 人员赋码数量等统计 【折线图】
* // *
* @param parentCode 父级code // * @param parentCode 父级code
* @param dataType 类型 - 人员、任务、设备等 // * @param dataType 类型 - 人员、任务、设备等
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY) // @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getQrCodeCountByStation") // @GetMapping(value = "/getQrCodeCountByStation")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】") // @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】")
public ResponseModel<List<Map<String, Object>>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode, // public ResponseModel<List<Map<String, Object>>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(required = false, value = "dataType") String dataType) { // @RequestParam(required = false, value = "dataType") String dataType) {
List<Map<String, Object>> qrCodeCountByStation = stationQrCodeStatisticsMapper.getQrCodeCountByStation(parentCode, dataType); // List<Map<String, Object>> qrCodeCountByStation = stationQrCodeStatisticsMapper.getQrCodeCountByStation(parentCode, dataType);
return ResponseHelper.buildResponse(qrCodeCountByStation); // return ResponseHelper.buildResponse(qrCodeCountByStation);
} // }
//
//
/** // /**
* 百分比 // * 百分比
* // *
* @param numerator 分子 // * @param numerator 分子
* @param denominator 分母 // * @param denominator 分母
* @return 百分比 // * @return 百分比
*/ // */
private double getPercent(BigDecimal numerator, BigDecimal denominator) { // private double getPercent(BigDecimal numerator, BigDecimal denominator) {
BigDecimal multiply = numerator.divide(denominator.compareTo(BigDecimal.ZERO) != 0 ? denominator : new BigDecimal(1), 4, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)); // BigDecimal multiply = numerator.divide(denominator.compareTo(BigDecimal.ZERO) != 0 ? denominator : new BigDecimal(1), 4, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100));
return Math.abs(multiply.doubleValue()); // return Math.abs(multiply.doubleValue());
} // }
} }
...@@ -64,4 +64,96 @@ ...@@ -64,4 +64,96 @@
GROUP BY GROUP BY
WERKS WERKS
</select> </select>
<select id="getEquipYardStatistics" resultType="java.util.Map">
SELECT
a.QRCODE_COLOR as qrCodeColor,
count( 1 ) as value
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
GROUP BY
QRCODE_COLOR
</select>
<select id="getJobYardStatistics" resultType="java.util.Map">
SELECT
a.QRCODE_COLOR as qrCodeColor,
count( 1 ) as value
FROM
fdgl_job_main a
LEFT JOIN privilege_company b on a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
GROUP BY
QRCODE_COLOR
</select>
<select id="getEquipYardByPage" resultType="java.util.Map">
SELECT
ifnull(a.SBMC, '') as objectName ,
ifnull(a.QRCODE_COLOR, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
ORDER BY a.CREATE_TIME DESC
limit #{current},#{size}
</select>
<select id="getEquipYardByPageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
</select>
<select id="getJobYardByPage" resultType="java.util.Map">
SELECT
ifnull(a.JOB_DESCRIPTION, '') as objectName ,
ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName
FROM
fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
ORDER BY a.CREATE_TIME DESC
limit #{current},#{size}
</select>
<select id="getJobYardByPageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
<where>
<if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if>
</where>
</select>
</mapper> </mapper>
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