【BUG修复】结果集数据无法显示<只显示BaseEntity 中的数据>

查询结果

在这里插入图片描述
数据集中的数据是 BaseEntity中的数据。

如下:

public class BaseEntity implements Serializable{
    private static final long serialVersionUID = 1L;

    /** 搜索值 */
    private String searchValue;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /** 备注 */
    private String remark;

    /** 请求参数 */
    private Map<String, Object> params;

我的SQL语句如下:

<resultMap type="BbCoordInfo" id="BbCoordInfoResult">
        <result property="wsId"    column="WS_ID"    />
        <result property="wsName"    column="WS_Name"    />
        <result property="cId"    column="CID"    />
        <result property="cName"    column="CName"    />
        <result property="macId"    column="Mac_ID"    />
        <result property="macCode"    column="Mac_Code"    />
        <result property="coordX"    column="coord_x"    />
        <result property="coordY"    column="coord_y"    />
        <result property="statusCode"    column="RunStatus"    />
        <result property="statusText"    column="status_text"    />
        <result property="macIP"    column="Mac_ConnectIP"    />
    </resultMap>

    <select id="selectBbCoordDetailList" parameterType="Long" resultMap="BbCoordInfoResult">
        select g.WS_ID ,g.WS_Name,b.CID ,b.CName  ,a.Mac_ID ,
               c.Mac_Code ,b.coord_x ,b.coord_y ,d.RunStatus,
               e.status_text ,f.Mac_ConnectIP from BU_Machine_Coord a
                   left join BB_Coord  b on a.Mac_CoordID = b.CID
                   left join BU_Machine_BasicInfo c on a.Mac_ID = c.Mac_ID
                   left join BU_Machine_CurrStatus d on a.Mac_ID = d.Mac_ID
                   left join BB_Status_Info e on d.RunStatus = e.status_id
                   left join BU_Machine_IP f on a.Mac_ID = f.Mac_ID
                   left join BB_WorkShop g on b.WS_ID = g.WS_ID
        <where>
            b.IsDel = 0
            <if test="wsId != null  and wsId != ''"> and g.WS_ID = #{wsId}</if>
        </where>
        order by CID asc
    </select>

我在后端控制台打印结果集数据如下:

在这里插入图片描述
也就是说:

数据集里有数据,但是返回的时候没有显示。

为什么呢

我的后台代码如下:
在这里插入图片描述
我忽然发现,如果查询的是单个实体类对象,才会放到AjaxResult

如果查询的是实体类的List集合,一般是放到TableDataInfo中去

修改代码如下:

在这里插入图片描述
测试,发现还是不行。

在这里插入图片描述

没辙了

我实在不知道是什么原因导致的了。

代码完全一样。

只能使出压箱底绝活了

代码比对

在这里插入图片描述
我气的真想抽我一巴掌。

我他妈的竟然忘了写getset方法。

lombok用多了,人就容易犯浑

彻底修复

添加 get和set方法,BUG被修复

成功获取数据:
在这里插入图片描述

posted @ 2021-11-20 10:59  layman~  阅读(25)  评论(0编辑  收藏  举报