Browse Source

重要事件文件查询逻辑

develop
lau572 6 months ago
parent
commit
222eef13f7
  1. 8
      zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java
  2. 9
      zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java
  3. 3
      zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml

8
zc-business/src/main/java/com/zc/business/mapper/DcEventImportantFileMapper.java

@ -68,4 +68,12 @@ public interface DcEventImportantFileMapper
* @return 结果
*/
int getImportantFileStatus(String eventId);
/**
* 获取重要事件的上报状态
*
* @param dcEventImportantFile 事件
* @return 结果
*/
int selectStatus(DcEventImportantFile dcEventImportantFile);
}

9
zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java

@ -62,6 +62,15 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer
@Override
public List<DcEventImportantFile> selectDcEventImportantFileList(DcEventImportantFile dcEventImportantFile)
{
int type = dcEventImportantFileMapper.getImportantFileStatus(dcEventImportantFile.getEventId());
//已初报待续报的, 如果查初报只能查上报了的
if ((type == 1 || type == 2) && dcEventImportantFile.getType().equals("1")){
dcEventImportantFile.setStatus("1");
} else if (type == 3){
//已终报的, 不管查什么类型的都只能查已上报状态的
dcEventImportantFile.setStatus("1");
}
return dcEventImportantFileMapper.selectDcEventImportantFileList(dcEventImportantFile);
}

3
zc-business/src/main/resources/mapper/business/DcEventImportantFileMapper.xml

@ -48,6 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM `dc_event_important_file`
where event_id = #{eventId} and status = '1'
</select>
<select id="selectStatus" parameterType="DcEventImportantFile" resultType="java.lang.Integer">
select IFNULL(max(status),0) status from dc_event_important_file where event_id = #{eventId} and type = #{type}
</select>
<insert id="insertDcEventImportantFile" parameterType="DcEventImportantFile" useGeneratedKeys="true" keyProperty="id">
insert into dc_event_important_file

Loading…
Cancel
Save