Commit 379a6f77 by zhoujinghao

导入相关代码优化

1 parent 5c4d0db5
......@@ -56,14 +56,12 @@ public class ImportExcelServiceImpl implements IImportExcelService {
if (!list.isEmpty()) {
for (ImportExcelDto data : list) {
int i = importExcelMapper.insertExcelData(data);
if (i < 0) {
if (i < 0){
return new ApiResponse(ApiResponse.FAIL, ApiResponse.FAIL_TEXT);
} else {
return new ApiResponse(ApiResponse.SUCCESS, ApiResponse.SUCCESS_TEXT);
}
}
}
return new ApiResponse(ApiResponse.FAIL, "导入时数据为空,导入失败");
return new ApiResponse(ApiResponse.SUCCESS, ApiResponse.SUCCESS_TEXT);
}
......
......@@ -4,7 +4,6 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="org.nafmii.admin.user.entity.ImportExcelPO">
<id column="ID" property="id" />
<result column="COLUMN1" property="column1" />
<result column="COLUMN2" property="column2" />
<result column="COLUMN3" property="column3" />
......@@ -13,9 +12,9 @@
<insert id ="insertExcelData" parameterType="org.nafmii.admin.user.dto.ImportExcelDto" >
insert into IMPORT_EXCEL_TEST
(COLUMN1,COLUMN2,COLUMN3)
values(#{ImportExcelPO.column1},
#{ImportExcelPO.column2},
#{ImportExcelPO.column3})
values(#{column1},
#{column2},
#{column3})
</insert >
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!