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'、'$'、'&'等。一般在英文...
public class test { public static void main(String[] args) { &...
public class test { public static void main(String[] args) { &...
(1).final 修饰符通常和 static 修饰符一起使用来创建类常量。(2).父类中的 final 方法可以被子类继承,但是不能被子类重写,声明 final 方法的主要目的是防止该方法的内容被修改。public class Member {  ...
java判断字符是否是一个字母System.out.println(Character.isLetter('a'));java判断字符是否是一个数字System.out.println(Character.isDigit('0'));java判断字符是否是一个空白Sy...
(1).java睡眠函数Thread.sleep(时间); //单位为毫秒(2).java睡眠函数例子Date dNow = new Date(); SimpleDateFormat ft = new&nbs...