Commit 9e326fe7 authored by tianyiming's avatar tianyiming

两个规定-三项制度统计优化

parent 8fc4bbc7
......@@ -15,7 +15,9 @@ import java.util.List;
*/
public interface ThreeSystemsMapper extends BaseMapper<ThreeSystems> {
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("startDay") String startDay, @Param("endDay") String endDay);
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("staticTableName") String staticTableName,
@Param("startDay") String startDay,
@Param("endDay") String endDay);
void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList);
......
......@@ -10,27 +10,26 @@
ei.supervise_org_code supervisoryUnitOrgCode,
ei.unit_type unitType,
CASE
WHEN (
SELECT COUNT
( 1 )
FROM
amos_tzs_biz.p_plan_task pt
${staticTableName} pt
WHERE
pt.finish_status = '2'
AND ppt.use_code = pt.use_code
AND pt.check_date BETWEEN #{startDay}
pt.not_start = 0
AND pt.time_out = 0
AND (pt.risk_end > 0 or pt.no_risk_end > 0)
AND psd.unit_code = pt.unit_code
AND pt.check_time BETWEEN #{startDay}
AND #{endDay}
AND pt.plan_type = #{type}
) > 0 THEN
1 ELSE 0
END AS checkStatus
FROM
amos_tzs_biz.tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code
tz_base_enterprise_info ei
LEFT JOIN ${staticTableName} psd ON ei.use_code = psd.unit_code
GROUP BY
ei.use_code
</select>
<select id="saveOrUpdateBatch">
......
......@@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List;
@RestController
@Api(tags = "三个规定统计")
@Api(tags = "三个制度统计")
@RequestMapping(value = "/threeProvisions")
public class ThreeSystemsController<string> extends BaseController {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
......
......@@ -156,6 +156,7 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
companyDto.setCheckStartTime(ObjectUtils.isEmpty(companyDto.getCheckStartTime()) ? startDay : companyDto.getCheckStartTime());
companyDto.setCheckEndTime(ObjectUtils.isEmpty(companyDto.getCheckEndTime()) ? endDay : companyDto.getCheckEndTime());
// todo 此处统计表名通过接口查询得到 接口暂未实现
String planType = companyDto.getPlanType();
String staticTableName = "p_static_day";
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, staticTableName, companyDto);
}
......
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