摘要:
利用mybatis拦截器做数据权限管理,拦截sql并分析、修改然后重新set。然而有的生效有的不生效。控制台打印的信息表示所有的sql都是修改成功的,那么问题在于重新set的方法。 一开始用的方法是这个: 阅读全文
摘要:
在"insert into"前面添加: <selectKey keyProperty="pk_name" order="AFTER" resultType="java.lang.Integer"> select seq_name.currval from dual</selectKey> 其中,pk 阅读全文
摘要:
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 阅读全文
摘要:
HSSF对应97-2003版本的Excel,XSSF则对应2007版本的Excel。 阅读全文
摘要:
dao: int insertBatch(List<P> pos); xml: <insert id="insertBatch" parameterType="list" useGeneratedKeys="false" databaseId="oracle"> insert into table_ 阅读全文
摘要:
1.新建测试类。若用idea,可用alt+insert快捷键生成。 2.测试类加上这两个注解: @RunWith(SpringJUnit4ClassRunner.class)@SpringBootTest(classes = Application.class) (Application.class 阅读全文
摘要:
1.在前端使用window.location.href访问下载方法api,而非ajax。 2.若后台报HttpMediaTypeNotAcceptableException: Could not find acceptable representation异常,将下载方法的返回值改为void。 阅读全文