使用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>

上一篇:Docker Swarm 常用命令


下一篇:CSharp: iTextSharp 5.1.32 create pdf