Commit 5aa43a79 authored by 吴卿华's avatar 吴卿华

多选

parent 95f5a2fd
...@@ -149,13 +149,17 @@ public class TBankSubjectController extends BaseController ...@@ -149,13 +149,17 @@ public class TBankSubjectController extends BaseController
List jsonArray=new ArrayList(); List jsonArray=new ArrayList();
try{ try{
//判断题目 和答案不能为空 //判断题目 和答案不能为空
if (!StringUtils.isEmpty(row.getCell(0).toString())&&!StringUtils.isEmpty(row.getCell(9).toString())){ if (!StringUtils.isEmpty(row.getCell(0).toString())&&!StringUtils.isEmpty(row.getCell(9).toString())
&&!StringUtils.isEmpty(row.getCell(10).toString())){
successNum++; successNum++;
/**题库id*/ /**题库id*/
excelEntity.setBankId(bankId); excelEntity.setBankId(bankId);
/**题目*/ /**题目*/
excelEntity.setTopicTitle(row.getCell(0).toString()); excelEntity.setTopicTitle(row.getCell(0).toString());
/**选项*/ System.out.println(row.getCell(10).toString());
/**题目类型*/
excelEntity.setTopicType(Integer.valueOf(row.getCell(10).toString()));
/**题目*/
for (int s=1;s<=8;s++){ for (int s=1;s<=8;s++){
JSONObject jsonObject=new JSONObject(); JSONObject jsonObject=new JSONObject();
if (!StringUtils.isEmpty(row.getCell(s).toString())) { if (!StringUtils.isEmpty(row.getCell(s).toString())) {
...@@ -164,6 +168,8 @@ public class TBankSubjectController extends BaseController ...@@ -164,6 +168,8 @@ public class TBankSubjectController extends BaseController
} }
} }
/**答案*/ /**答案*/
excelEntity.setAnswer(row.getCell(9).toString());
// if ("A".equals(row.getCell(9).toString())){ // if ("A".equals(row.getCell(9).toString())){
// excelEntity.setAnswer(0); // excelEntity.setAnswer(0);
// }else if ("B".equals(row.getCell(9).toString())){ // }else if ("B".equals(row.getCell(9).toString())){
......
...@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <if test="answer != null "> and answer = #{answer}</if>--> <!-- <if test="answer != null "> and answer = #{answer}</if>-->
<!-- <if test="datetime != null "> and datetime = #{datetime}</if>--> <!-- <if test="datetime != null "> and datetime = #{datetime}</if>-->
</where> </where>
group by subject_id desc
</select> </select>
<select id="selectTBankSubjectById" parameterType="Long" resultMap="TBankSubjectResult"> <select id="selectTBankSubjectById" parameterType="Long" resultMap="TBankSubjectResult">
...@@ -80,10 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -80,10 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--excel导入--> <!--excel导入-->
<insert id="insertBank"> <insert id="insertBank">
insert into t_bank_subject (bank_id,topic_title,topic_option,answer,datetime) insert into t_bank_subject (bank_id,topic_title,topic_option,answer,datetime,topic_type)
values values
<foreach collection="list" item="item" index= "index" separator =","> <foreach collection="list" item="item" index= "index" separator =",">
( #{item.bankId},#{item.topicTitle},#{item.topicOption},#{item.answer},#{item.datetime}) ( #{item.bankId},#{item.topicTitle},#{item.topicOption},#{item.answer},#{item.datetime},#{item.topicType})
</foreach> </foreach>
</insert> </insert>
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!-- SpringBoot的依赖配置--> <!-- SpringBoot的依赖配置-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
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