通过mybatis拿到的不是最大值,而是根据zdid 查询获取到的数据库最后一个值

为什么我数据库拿到的是最大值,通过mybatis拿到的就不是最大值了
通过mybatis拿到的数据,只是拿到数据库之后一个

img

img

img


<select id="queryall" resultMap="zd">
        select
        a.zdid,a.zc_name,a.zc_category,a.zc_guishu,a.zeren_ren,a.pinpai,a.xinghao,a.cs_bianhao,a.weizhi,a.xinxi,
        a.zc_bianhao,a.fixed_assets_name,a.use_bumen,a.use_people,a.city,a.STORAGE_LOCATION,a.ruku_date,a.ruku_jine,
        a.weibao_sdate,a.weibao_mode,a.contaccts,a.phone,a.beizhu,
        b.dengji_yonghu,b.dengji_date,b.remarks,
        c.state_name
       from
       zdgu a inner join caozuo_jilu b on a.zdid=b.zdid
       inner join zc_state c on c.zc_state_id=a.zc_state_id
       <where>
           <if test="zdid!=null">
             or  a.zdid=#{zdid}
           </if>
           <if test="zc_bianhao!=null">
               or a.zc_bianhao=#{zc_bianhao}
           </if>
           <if test="cs_bianhao!=null">
               or a.cs_bianhao=#{cs_bianhao}
           </if>
           and b.dengji_date=(select max(dengji_date) from caozuo_jilu)
        </where>
    </select>

你的dengji_date是什么类型的

1:检查是不是同一个库
2:查看最终执行的sql

你确定看的是同一个数据库的同一个表?