其他分享
首页 > 其他分享> > 使用Mybatis plus xml 记录过程

使用Mybatis plus xml 记录过程

作者:互联网


 <select id="selectByConditions"
    resultType="com.springboot.domain.DemoQueryModel">

        select
        create_date ,
        identity ,
        user_count ,
        concat(sum(sd.xxxcount)) xxxcount
        from  user u
    <where>
      <if test="demoQueryModel.startDate != null ">
        AND u.create_date &gt;=  #{demoQueryModel.startDate}
      </if>
      <if test="demoQueryModel.endDate != null   ">
        AND u.create_date  &lt;=  #{demoQueryModel.endDate}
      </if>
      <if test="demoQueryModel.identity != null and demoQueryModel.identity.size>0">
        AND u.identity in
        <foreach collection="demoQueryModel.identity" item="demoQueryModel.identity" open="(" separator="," close=")">
          #{demoQueryModel.identity}
        </foreach>
      </if>
    </where>
        GROUP BY u.user_id 
  </select>

标签:xml,date,create,demoQueryModel,plus,user,Mybatis,identity,xxxcount
来源: https://www.cnblogs.com/xmxblogs/p/15848052.html