|
@@ -4,19 +4,61 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.MedClickInfo">
|
|
|
- <id column="id" property="id" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="dept_id" property="deptId" />
|
|
|
- <result column="dept_name" property="deptName" />
|
|
|
- <result column="doctor_id" property="doctorId" />
|
|
|
- <result column="doctor_name" property="doctorName" />
|
|
|
- <result column="qcresult_info_id" property="qcresultInfoId" />
|
|
|
- <result column="behospital_code" property="behospitalCode" />
|
|
|
- <result column="is_deleted" property="isDeleted" />
|
|
|
- <result column="gmt_create" property="gmtCreate" />
|
|
|
- <result column="gmt_modified" property="gmtModified" />
|
|
|
- <result column="creator" property="creator" />
|
|
|
- <result column="modifier" property="modifier" />
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="dept_id" property="deptId"/>
|
|
|
+ <result column="dept_name" property="deptName"/>
|
|
|
+ <result column="doctor_id" property="doctorId"/>
|
|
|
+ <result column="doctor_name" property="doctorName"/>
|
|
|
+ <result column="qcresult_info_id" property="qcresultInfoId"/>
|
|
|
+ <result column="behospital_code" property="behospitalCode"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="gmt_create" property="gmtCreate"/>
|
|
|
+ <result column="gmt_modified" property="gmtModified"/>
|
|
|
+ <result column="creator" property="creator"/>
|
|
|
+ <result column="modifier" property="modifier"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <select id="getQcClick" resultType="com.diagbot.dto.GetQcClickDTO">
|
|
|
+ select
|
|
|
+ t.deptId,
|
|
|
+ t.deptName,
|
|
|
+ t.clickNum
|
|
|
+ from(
|
|
|
+ SELECT
|
|
|
+ a.dept_id as deptId,
|
|
|
+ a.dept_name as deptName,
|
|
|
+ count(*) as clickNum
|
|
|
+ FROM
|
|
|
+ med_click_info a
|
|
|
+ where
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ and a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and a.dept_name like CONCAT('%',#{deptName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ and a.dept_id= #{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ <![CDATA[ and a.gmt_create >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ <![CDATA[ and a.gmt_create < #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ group by
|
|
|
+ a.dept_id,
|
|
|
+ a.dept_name
|
|
|
+ order by
|
|
|
+ a.dept_id,
|
|
|
+ a.dept_name)t
|
|
|
+ <if test="asc == 'clickNum'">
|
|
|
+ order by t.clickNum
|
|
|
+ </if>
|
|
|
+ <if test="desc =='clickNum'">
|
|
|
+ order by t.clickNum desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|