<select></select> 对应注解@lSelect <update></update> 对应注解@Update <insert></insert> 对应注解@Insert <delete></delete> 对应注解@Delete <where></where>:在某些条件根据入参有无决定是可使用以避免1=1这种写法,也会根据是否为where条件后第一个条件参数自动去除and <if></if>:类似于java中的条件...
else{ //存在where条件and处理 plainSelect.setWhere(newAndExpression(plainSelect.getWhere(),inExpression)); } }elseif("mobile".equals(dataColumn.getName())){ //支持一个自定义条件 LikeExpressionlikeExpression=newLikeExpression(); likeExpression.setLeftExpression(newColumn(dataColumn.getAliasDotName()))...
} else if (method.returnsMap()) {//返回结果为Map result = executeForMap(sqlSession, args); } else if (method.returnsCursor()) {//返回结果为Cursor result = executeForCursor(sqlSession, args); } else {//返回结果不是上面的情况,此处查询的1条数据,所以进入属于这种情况 //将参数转换一下 Obj...
protected void processSelect(Select select, int index, String sql, Object obj) { SelectBody selectBody = select.getSelectBody(); if (selectBody instanceof PlainSelect) { this.setWhere((PlainSelect) selectBody, (String) obj); } else if (selectBody instanceof SetOperationList) { SetOperation...
} else if (!isReadPK) { isPK = isReadPK = initTableIdWithoutAnnotation(globalConfig, tableInfo, field); } if (isPK) { if (orderBy != null) { tableInfo.getOrderByFields().add(new OrderFieldInfo(tableInfo.getKeyColumn(), orderBy.asc(), orderBy.sort())); ...
/*** 查询多个部门(其中一个部门有多个用户)*/publicList<DeptVo>getDeptByList() {//按条件查询部门信息List<Dept> deptList =deptMapper.selectList(Wrappers.emptyWrapper()); List<DeptVo> deptVos = deptList.stream().map(DeptVo::new).collect(toList());if(deptVos.size() > 0) { ...
1、`< if>` 2、`< choose>...< when>...< otherwise>` 3、`< foreach>` 4、`< trim prefix="SET" suffixOverrides=",">` 5、`< bind>` 6、`< typeAlias> 类型别名` 二、增、删、改、查 1、`< select>` 2、`< insert>` 3、`< delete>` ...
MappedStatementmappedStatement= (MappedStatement) metaObject.getValue("delegate.mappedStatement");if (SqlCommandType.SELECT != mappedStatement.getSqlCommandType() ||StatementType.CALLABLE== mappedStatement.getStatementType()) { return invocation.proceed();} ...
今天介绍一个 MyBatis - Plus 官方发布的神器:mybatis-mate 为 mp 企业级模块,支持分库分表,数据审计、数据敏感词过滤(AC算法),字段加密,字典回写(数据绑定),数据权限,表结构自动生成 SQL 维护等,旨在更敏捷优雅处理数据。 ◆1. 主要功能 字典绑定