1、POI
若你的是web Project工程,就直接把poi.jar包复制粘贴到webroot的web-inf下面的lib文件夹里面;
若你的是java Project工程,就打开盖工程的属性(Properties)找到他的java build path然后有个Libraries选项卡在右侧可通过Add jars来添加放置在工程里面的poi.jar包,如果你的这个poi.jar包不是放在工程中的,可以通过add external jars来添加外部jar包
web-inf下面的lib文件夹里面;
若你的是java Project工程,就打开盖工程的属性(Properties)找到他的java build path然后有个Libraries选项卡在右侧可通过Add jars来添加放置在工程里面的poi.jar包,如果你的这个poi.jar包不是放在工程中的,可以通过add external jars来添加外部jar包
1)、用HSSFWorkbook打开或者创建“Excel文件对象”
2)、用HSSFWorkbook对象返回或者创建Sheet对象
3)、用Sheet对象返回行对象,用行对象得到Cell对象
4)、对Cell对象读写。
5)、将生成的HSSFWorkbook放入HttpServletResponse中响应到前端页面
2、档案管理员角色24,用于生成工程量清单和目录,上传补充资料等。
3、mybatis user 相关,增加了方法findByPsn(int psn);
4、mybatis批量sql操作,需要将mysql许可打开
<property name="url" value="jdbc:mysql://localhost:3306/db_2?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true",再在Mpper文件里写批量sql语句:
<!-- 批量插入 -->
<insert id="insertBatch">
insert into dangan (psn, pname, code, yc, status, category, bigtype, smalltype,dano,dt) values
<foreach collection ="list" item="da" separator =",">
(#{da.psn}, #{da.pname},#{da.code},#{da.yc},#{da.status},#{da.category},#{da.bigtype},#{da.smalltype},#{da.dano},#{da.dt})
</foreach >
</insert>
<!-- 批量 更新 档案清单目录, 类似case 语句-->
<update id="updateBatch" parameterType="java.util.List">
update dangan set
yc=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.yc,jdbcType=VARCHAR}
</foreach>
,status=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.status,jdbcType=SMALLINT}
</foreach>
,dano=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.dano,jdbcType=VARCHAR}
</foreach>
,dt=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.dt,jdbcType=VARCHAR}
</foreach>
,ly=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.ly,jdbcType=VARCHAR}
</foreach>
,gzuser=
<foreach collection="list" item="item" index="index" separator=" " open="case sn" close="end">
when #{item.sn,jdbcType=BIGINT} then #{item.gzuser,jdbcType=VARCHAR}
</foreach>
where sn in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item.sn,jdbcType=BIGINT}
</foreach>
</update>
5、增加新表:提示造价员补充资料,gzUser
6、增加新表:工作日志worklog
7、使用mybatis插入自增主键ID的数据后返回自增的ID
https://www.cnblogs.com/zhuzhen/p/6894995.html