摘要: 利用mybatis拦截器做数据权限管理,拦截sql并分析、修改然后重新set。然而有的生效有的不生效。控制台打印的信息表示所有的sql都是修改成功的,那么问题在于重新set的方法。 一开始用的方法是这个: 阅读全文
posted @ 2019-07-30 18:26 龙门之桐 阅读(3459) 评论(1) 推荐(0) 编辑
摘要: 在"insert into"前面添加: <selectKey keyProperty="pk_name" order="AFTER" resultType="java.lang.Integer"> select seq_name.currval from dual</selectKey> 其中,pk 阅读全文
posted @ 2019-07-17 17:12 龙门之桐 阅读(3244) 评论(0) 推荐(0) 编辑
摘要: sql是这样的: select d.DEPT_ID,get_deptname_by_deptid(d.DEPT_ID) as d.DEPT_NAMEfrom sys_department d join ... 改成这样就好了: select d.DEPT_ID,get_deptname_by_dep 阅读全文
posted @ 2019-07-09 12:30 龙门之桐 阅读(2547) 评论(0) 推荐(0) 编辑
摘要: HSSF对应97-2003版本的Excel,XSSF则对应2007版本的Excel。 阅读全文
posted @ 2019-07-02 19:06 龙门之桐 阅读(4170) 评论(0) 推荐(1) 编辑
摘要: dao: int insertBatch(List<P> pos); xml: <insert id="insertBatch" parameterType="list" useGeneratedKeys="false" databaseId="oracle"> insert into table_ 阅读全文
posted @ 2019-07-02 19:03 龙门之桐 阅读(5295) 评论(0) 推荐(0) 编辑
摘要: 1.新建测试类。若用idea,可用alt+insert快捷键生成。 2.测试类加上这两个注解: @RunWith(SpringJUnit4ClassRunner.class)@SpringBootTest(classes = Application.class) (Application.class 阅读全文
posted @ 2019-07-01 19:39 龙门之桐 阅读(3906) 评论(0) 推荐(0) 编辑
摘要: 1.在前端使用window.location.href访问下载方法api,而非ajax。 2.若后台报HttpMediaTypeNotAcceptableException: Could not find acceptable representation异常,将下载方法的返回值改为void。 阅读全文
posted @ 2019-07-01 19:12 龙门之桐 阅读(1390) 评论(0) 推荐(0) 编辑