feiyu02
2024-09-27 72a384981ec78139dbe919597b54efedcc7f33aa
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
@@ -23,8 +23,6 @@
 */
class DataSource(val config: ExcelConfigVo, val dbMapper: DbMapper){
    private val dateUtil = DateUtil()
    private val sourceList = mutableListOf<Subtask>()
    var year = 0
@@ -70,7 +68,7 @@
     */
    fun areaName(): String {
        val t = dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid)
        return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
        return "${DateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
    }
    /**
@@ -96,14 +94,10 @@
        //1. 查找特定的巡查任务或者所有的计划巡查任务
        var taskSceneIdList = listOf<String>()
        val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true ||
            (config.startTime != null || config.endTime != null)
        ) {
        val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true) {
            dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                createCriteria().apply {
                    if (config.subTaskIdList?.isNotEmpty() == true) {
                        andIn("stguid", config.subTaskIdList)
                    }
                    andIn("stguid", config.subTaskIdList)
                    config.startTime?.let { andGreaterThanOrEqualTo("planstarttime", it) }
                    config.endTime?.let { andLessThanOrEqualTo("planendtime", it) }
                    config.districtCode?.let { andEqualTo("districtcode", it) }
@@ -114,8 +108,9 @@
            taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config
                .sceneType, config.townCode).map { it.guid ?: "" }
            dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                createCriteria().andIn("scenseid", taskSceneIdList)
                    .andEqualTo("tguid", config.topTaskGuid)
                createCriteria().apply {
                    if (taskSceneIdList.isNotEmpty()) andIn("scenseid", taskSceneIdList)
                }.andEqualTo("tguid", config.topTaskGuid)
            })
        }