mybatismybatis-generatormybatis-mapper

function countByExample mybatis-generator help me


I have a problem, in my picture. I use mybatis and countByExample method was generated by MyBatis Generator. Can u help me and see it?

https://i.sstatic.net/e3arE.png

https://i.sstatic.net/WOp1f.png


Solution

  • It looks like you are reusing jobCtrlExample between method calls. if you do that, then you need to clear the previous conditions before you set new conditions. Probably adding this line will fix it:

    jobCtrlExample.clear();
    

    It would be better to create a new example class for every method.