12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.qxgmat.data.relation.UserTextbookEnrollRelationMapper">
- <resultMap id="IdMap" type="com.qxgmat.data.dao.entity.UserTextbookEnroll">
- <!--
- WARNING - @mbg.generated
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- </resultMap>
- <resultMap id="NumberMap" type="com.qxgmat.data.relation.entity.TextbookEnrollNumberRelation">
- <!--
- WARNING - @mbg.generated
- -->
- <id column="month" jdbcType="TIMESTAMP" property="month" />
- <id column="number" jdbcType="INTEGER" property="number" />
- </resultMap>
- <sql id="Id_Column_List">
- <!--
- WARNING - @mbg.generated
- -->
- ute.`id`
- </sql>
- <!--
- 统计报名人数
- -->
- <select id="groupByMonth" resultMap="NumberMap">
- select
- count(ute.`id`) as `number`, ute.`month` as `month`
- from `user_textbook_enrool` ute
- where 1
- <if test="startTime != null">
- and ute.`month` > #{startTime,jdbcType=VARCHAR}
- </if>
- <if test="endTime != null">
- and ute.`month` < #{endTime,jdbcType=VARCHAR}
- </if>
- </select>
- </mapper>
|