
mybatis
文章平均质量分 52
潇凝子潇
世界上有两种【没有bug】的代码。 一种是 【没有明显bug的代码】,另一种是【明显没有bug的代码】。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
mybatis #{}和${}的区别是什么
1. #{}是预编译处理,${}是字符串替换。2. Mybatis 在处理#{}时,会将 sql 中的#{}替换为?号,调用 PreparedStatement 的 set 方法来赋值;3. Mybatis 在处理${}时,就是把${}替换成变量的值。4. 使用#{}可以有效的防止 SQL 注入,提高系统安全性。...原创 2020-04-13 10:55:13 · 209 阅读 · 0 评论 -
利用 tk.mybatis 分批查询数据
Example pushPlanExample = new Example(PushPlan.class);Criteria criteria = pushPlanExample.createCriteria();criteria.andLessThanOrEqualTo("pushTriggerTime", curDate);// 获取总数int count = pushPla...原创 2020-03-27 18:36:24 · 2196 阅读 · 0 评论 -
mybatis 多字段模糊查询写法
<sql id="where_condition"> <where> <if test="companyId != null"> and company_id = #{companyId} </if> <if test="likeEmployeeNameOrmobile != null and...原创 2019-04-09 16:46:18 · 1454 阅读 · 0 评论 -
mybatis 返回 map 一条 及多条记录
一 返回一条记录的map1. mapper.xml 中 resultType="map" <select id="getEmpByIdReturnMap" resultType="map"> select * from employee where id=#{id}</select>2. 接口中 //key就是列名,值就是对应的值pu...原创 2018-10-01 22:25:53 · 12160 阅读 · 0 评论 -
java.lang.IllegalStateException: Type handler was null on parameter mapping for property '__frch_it
2018-08-28 17:13:21 ERROR com.sprucetec.osc.task.ScanBalanceTask scanBalanceInnerNew:114 - ScanBalance Failed!org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptio...原创 2018-08-28 18:20:52 · 37941 阅读 · 0 评论 -
mybatis 通用更新抽离写法
前提是要更新的表中的字段名称必须命名统一1. import com.alibaba.fastjson.JSONObject;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.annotation.Autowired;import org.s...原创 2018-08-14 12:24:47 · 700 阅读 · 0 评论 -
mybatis 批量更新
1.mapper public interface FiInvoiceOcrMapper { void updateTaxDifference(@Param("taxDifferences") List<FiInvoiceOcr> taxDifferences);}2.mapper.xml<!--更新税差--><!--@author -->&...原创 2018-07-13 13:14:38 · 222 阅读 · 0 评论 -
mybatis 多个字段模糊匹配
<!--获取归档人--><!--@author --><!--@since 2018-07-17--><select id="getArchiveInfo" parameterType="string" resultMap="BaseMap"> SELECT DISTINCT archive_id AS id ,arch原创 2018-07-17 18:20:30 · 6467 阅读 · 0 评论