<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 >= #{demoQueryModel.startDate}
</if>
<if test="demoQueryModel.endDate != null ">
AND u.create_date <= #{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>