hana数据库查询语句如下:
SELECT * FROM "_SYS_BIC"."ellassay.public/AT_DIM_SAP_DEPOT_ALL_NEW_JTBB" WHERE DEPOTID_JTBB ='S2351001'
想通过
@TableName(" \"_SYS_BIC\".\"ellassay.public/AT_DIM_SAP_DEPOT_ALL_NEW_JTBB\"")进行查询,结果全部是null,于是通过自定xml进行查询
(1).创建xml
src/main/resources/mapper/AtDimSapDepotAllNewJtbb.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.learn.mapper.AtDimSapDepotAllNewJtbbMapper"> <select id="getList" resultType="com.learn.entity.AtDimSapDepotAllNewJtbb"> SELECT * FROM "_SYS_BIC"."ellassay.public/AT_DIM_SAP_DEPOT_ALL_NEW_JTBB" </select> </mapper>
(2).创建实体
package com.learn.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
@TableName(" \"_SYS_BIC\".\"ellassay.public/AT_DIM_SAP_DEPOT_ALL_NEW_JTBB\"")
public class AtDimSapDepotAllNewJtbb {
@TableField("PP")
public String PP;
public String getDEPOT_NAME() {
return DEPOT_NAME;
}
public void setDEPOT_NAME(String DEPOT_NAME) {
this.DEPOT_NAME = DEPOT_NAME;
}
@TableField("DEPOT_NAME")
public String DEPOT_NAME;
}(3).创建mapper
package com.learn.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learn.entity.AtDimSapDepotAllNewJtbb;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public interface AtDimSapDepotAllNewJtbbMapper extends BaseMapper<AtDimSapDepotAllNewJtbb> {
List<AtDimSapDepotAllNewJtbb> getList();
}(4).配置mybatis_pus
mybatis-plus: mapper-locations: classpath:mapper/*.xml configuration: map-underscore-to-camel-case: false
(5).进行查询
List<AtDimSapDepotAllNewJtbb> monthTargetDepot1 = atDimSapDepotAllNewJtbbMapper.getList();
其实是支持TableName转义字符串进行查询的,之所以查询的结果为null是因为没有关闭自动驼峰转换的原因, map-underscore-to-camel-case: false,这导致了 @TableField("nickname")注解失效了
字节(Byte)是计量单位,表示数据量多少,是计算机信息技术用于计量存储容量的一种计量单位,通常情况下一字节等于八位。字符(Character)计算机中使用的字母、数字、字和符号,比如'A'、'B'、'$'、'&'等。一般在英文...
(1).final 修饰符通常和 static 修饰符一起使用来创建类常量。(2).父类中的 final 方法可以被子类继承,但是不能被子类重写,声明 final 方法的主要目的是防止该方法的内容被修改。public class Member {  ...
java stringBuffer(1).stringBuffer和stringBuilder区别stringBuffer是线程安全的,stringBuilder速度更快(2).简单的stringBuffer例子StringBuffer sBuffer = new&nb...
java匹配一个字符串在另外一个字符串中出现的次数,java正则start,java正则end// 正则 String pattern = "\\bgao\\b"; // 字符串 String content ...
(4).java lookingAt匹配字符串和java matches匹配字符串lookingAt不要求整个字符串全匹配,例如me和me_you都是匹配的,但是lookingAt从第一个字符串开始匹配,匹配失败了也不会继续匹配,意味着me和you_me是无法匹配的matches匹配字符串要求全部匹...
假如有个字符串为"fatcatfatcatfat",正则为“cat”当调用appendReplacement(sb, "dog")时appendReplacement方法都会把匹配到的内容替换为dog,并把匹配到字符串的前面几个字符串+dog送给sb里,所以第...