新增问题1

Blade 未结 1 745
sunman
sunman 2021-06-08 15:02

新增之前都会先查询下:

SELECT

business_history_unit.id AS businessHistoryUnitId,

business_history_unit.huiIn AS businessHistoryUnitHuiin,

business_history_unit.time AS businessHistoryUnitTime,

business_history_unit.chaoOut AS businessHistoryUnitChaoout,

business_history_unit.chaoIn AS businessHistoryUnitChaoin,

business_history_unit.huiOut AS businessHistoryUnitHuiout,

business_history_unit. NAME AS businessHistoryUnitName,

business_history_unit.zhesuan AS businessHistoryUnitZhesuan,

business_history_unit. CODE AS businessHistoryUnitCode,

business_history_unit.englishcurrencyName AS businessHistoryUnitEnglishcurrencyname,

business_history_unit. DAY AS businessHistoryUnitDay,

business_history_unit.coinsymbol AS businessHistoryUnitCoinsymbol,

business_history_unit.exchangeunit AS businessHistoryUnitExchangeunit,

business_history_unit.historyId AS businessHistoryUnitHistoryid

FROM

business_history_unit

WHERE

CODE = '14841335'   Unknown column ''business_history_unit.huiIn'' in ''field list''

image.png

image.png

明明都是有的 ,还是报column 不存在


1条回答
  •  3395733618
    3395733618 (楼主)
    2021-06-08 15:27

    image.png

    你sql语句中的字段名和数据库里面的都不一样,怎么查得到?


    实体类中的注解是表示数据库字段和实体类属性的下划线转驼峰,你sql语句要和数据库的对应。

    作者追问:2021-06-08 15:27

    这我知道啊 @TableField("hui_in")   我用注解指定了映射数据库的字段hui_in

    作者追问:2021-06-08 15:27

    这查询语句是新增的时候  它自己查询的, 查询完之后才能新增。。。。

    0 讨论(0)
提交回复