search

Home  >  Q&A  >  body text

java - Mybatis executes sql summation problem

This is a summation sql I need to execute, and the query value count in the client is 0.
select count(1) as COUNT from dd_mst where ac_id=1000002400 and ac_seqn<>1 and ac_sts =' 1'

Call through the following tool class in the program:

The problem is that the program will return Count as 1, but other statistical SQLs are quite normal, which makes me very depressed.
Can you give me some ideas in this regard, about the logic of the selectList() method executed at the bottom of mybatis. (ps: I probably also understand that querying it through limited conditions will return a list<map>, and then the COUNT of item 0 of this map is the value of the statistical field)

淡淡烟草味淡淡烟草味2749 days ago728

reply all(1)I'll reply

  • 阿神

    阿神2017-06-14 10:53:48

    Why is it so complicated?

    Isn’t it good to directly define the return Integer? Why put it in a Map?

    The question is not very clear, so I can only guess:

    The column names of the database are not case-sensitive, but the keys of the Java Map are case-sensitive.

    reply
    0
  • Cancelreply