报错 org.springframework.dao.DataIntegrityViolationException: Error attempting to get column

发布时间 2023-11-02 13:24:17作者: 汤圆aiWL

 

 

 

原因是持久化层的字段属性  跟 数据库的没有对应上, 类型不对

dao.DataIntegrityViolationException: Error attempting to get column 'STATUS' from result set.  

  

<if test="record.status != null">
        'STATUS' = #{record.status,jdbcType=DECIMAL},
      </if>

比如数据库是 int类型的 Status,但是你上面是 字符串类型的