Commit 3b31990b authored by limei's avatar limei

根据模型id和机构id查询检查项总数和不合格总数

parent 4e470095
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/amos-boot-data/amos-boot-data-accessapi/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-api/amos-boot-module-kgd-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-biz/amos-boot-module-kgd-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-kgd/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" /> <output url="file://$PROJECT_DIR$/classes" />
......
package com.yeejoin.amos.boot.module.tdc.api.dto; package com.yeejoin.amos.boot.module.tdc.api.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -11,6 +13,12 @@ import java.util.Date; ...@@ -11,6 +13,12 @@ import java.util.Date;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("tdc_check_result") @TableName("tdc_check_result")
public class CheckTotalDto { public class CheckTotalDto {
private static final long serialVersionUID = 1L;
@TableId(value = "sequence_nbr", type = IdType.ID_WORKER)
protected Long sequenceNbr;
@ApiModelProperty(value="校验时间") @ApiModelProperty(value="校验时间")
private Date checkDate; private Date checkDate;
...@@ -25,14 +33,17 @@ public class CheckTotalDto { ...@@ -25,14 +33,17 @@ public class CheckTotalDto {
private String checkItemLabel; private String checkItemLabel;
private int modelId; private String modelId;
private String checkItemValue; private String checkItemValue;
private String checkExplain; private String checkExplain;
private String amosOrgCode;
private String total;
private String aaa;
} }
package com.yeejoin.amos.boot.module.tdc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckTotalDto;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckResult;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface CheckTotalMapper extends BaseMapper<CheckTotalDto> {
List<CheckTotalDto> selectTotal(String modelId,String amosOrgCode);
}
package com.yeejoin.amos.boot.module.tdc.api.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckTotalDto;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckResult;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface CheckTotalService extends IService<CheckTotalDto> {
List<CheckTotalDto> selectTotal(String modelId, String amosOrgCode);
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tdc.api.mapper.CheckResultMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tdc.api.mapper.CheckTotalMapper">
<select id="selectResult" resultType="com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto"> <select id="selectTotal" resultType="com.yeejoin.amos.boot.module.tdc.api.dto.CheckTotalDto">
select (select count(*) from `tdc_check_result` where model_id=#{model_id} and amos_org_code='amos_org_code')as `all_count`, SELECT count(1) as total, COUNT(CASE WHEN (check_item_result=1) THEN check_item_result END) AS aaa
(select count(*) from `tdc_check_result` where check_item_result='1' and model_id='model_id' and amos_org_code='amos_org_code')as `faile_count`; FROM tdc_check_result WHERE model_id = #{modelId} and amos_org_code = #{amosOrgCode}
</select> </select>
</mapper> </mapper>
...@@ -47,9 +47,9 @@ public class CheckResultController extends BaseController { ...@@ -47,9 +47,9 @@ public class CheckResultController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectCheckResult/{modelId}/{amosOrgCode}") @GetMapping(value = "/selectCheckResult")
@ApiOperation(httpMethod = "GET",value = "查询最后一次校验模型", notes = "查询最后一次校验模型") @ApiOperation(httpMethod = "GET",value = "查询最后一次校验模型", notes = "查询最后一次校验模型")
public ResponseModel<List<CheckResult>> selectCheckResult(@PathVariable String modelId,@PathVariable String amosOrgCode) { public ResponseModel<List<CheckResult>> selectCheckResult( String modelId, String amosOrgCode) {
return ResponseHelper.buildResponse(checkResultService.selectCheckResult(modelId,amosOrgCode)); return ResponseHelper.buildResponse(checkResultService.selectCheckResult(modelId,amosOrgCode));
} }
} }
package com.yeejoin.amos.boot.module.tdc.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckTotalDto;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckResultService;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckTotalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
@RestController
@Api(tags = "校验结果Api")
@RequestMapping(value = "/check")
public class CheckTotalController extends BaseController{
@Autowired
CheckTotalService checkTotalService;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectTotal")
@ApiOperation(httpMethod = "GET", value = "result", notes = "result")
public ResponseModel<List<CheckTotalDto>> selectTotal( String modelId,String amosOrgCode) {
return ResponseHelper.buildResponse(checkTotalService.selectTotal(modelId, amosOrgCode));
}
}
package com.yeejoin.amos.boot.module.tdc.biz.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckTotalDto;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckResult;
import com.yeejoin.amos.boot.module.tdc.api.mapper.CheckTotalMapper;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckResultService;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckTotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CheckTotalImpl extends ServiceImpl<CheckTotalMapper, CheckTotalDto> implements CheckTotalService {
@Autowired
CheckTotalMapper checkTotalMapper;
@Override
public List<CheckTotalDto> selectTotal(String modelId, String amosOrgCode) {
return checkTotalMapper.selectTotal(modelId, amosOrgCode);
}
}
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