| | |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS date, COUNT(*) AS number |
| | | FROM t_user |
| | | <where> |
| | | <if test="ids != null and ids.size() != 0"> |
| | | city_id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | <if test="city != null and city.size() != 0"> |
| | | city in |
| | | <foreach collection="city" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | and is_delete = 0 |
| | |
| | | FROM t_user |
| | | WHERE YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="increaseNumberByMonth" resultType="java.lang.Long"> |
| | |
| | | FROM t_user |
| | | WHERE MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | </mapper> |