|
@@ -4,23 +4,23 @@
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.diagbot.entity.TranLog">
|
|
|
- <id column="id" property="id" />
|
|
|
- <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" />
|
|
|
- <result column="patient_id" property="patientId" />
|
|
|
- <result column="hospital_id" property="hospitalId" />
|
|
|
- <result column="sub_hospital_code" property="subHospitalCode" />
|
|
|
- <result column="sub_hospital_name" property="subHospitalName" />
|
|
|
- <result column="scene_name" property="sceneName" />
|
|
|
- <result column="params" property="params" />
|
|
|
- <result column="result" property="result" />
|
|
|
- <result column="gmt_req" property="gmtReq" />
|
|
|
- <result column="gmt_resp" property="gmtResp" />
|
|
|
- <result column="exec_time" property="execTime" />
|
|
|
- <result column="success_flag" property="successFlag" />
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <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"/>
|
|
|
+ <result column="patient_id" property="patientId"/>
|
|
|
+ <result column="hospital_id" property="hospitalId"/>
|
|
|
+ <result column="sub_hospital_code" property="subHospitalCode"/>
|
|
|
+ <result column="sub_hospital_name" property="subHospitalName"/>
|
|
|
+ <result column="scene_name" property="sceneName"/>
|
|
|
+ <result column="params" property="params"/>
|
|
|
+ <result column="result" property="result"/>
|
|
|
+ <result column="gmt_req" property="gmtReq"/>
|
|
|
+ <result column="gmt_resp" property="gmtResp"/>
|
|
|
+ <result column="exec_time" property="execTime"/>
|
|
|
+ <result column="success_flag" property="successFlag"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getPage" resultType="com.diagbot.entity.TranLog">
|
|
@@ -33,6 +33,9 @@
|
|
|
<if test="tranLogPageVO.hospitalId != null">
|
|
|
AND a.hospital_id = #{tranLogPageVO.hospitalId}
|
|
|
</if>
|
|
|
+ <if test="tranLogPageVO.deptName != null and tranLogPageVO.deptName !=''">
|
|
|
+ AND a.dept_name LIKE CONCAT( '%', #{tranLogPageVO.deptName}, '%' )
|
|
|
+ </if>
|
|
|
<if test="tranLogPageVO.patientId != null and tranLogPageVO.patientId != ''">
|
|
|
AND a.patient_id LIKE CONCAT( '%', #{tranLogPageVO.patientId}, '%' )
|
|
|
</if>
|
|
@@ -43,11 +46,13 @@
|
|
|
AND a.sub_hospital_name LIKE CONCAT( '%', #{tranLogPageVO.subHospitalName}, '%' )
|
|
|
</if>
|
|
|
<if test="tranLogPageVO.startGmtReq != null and tranLogPageVO.endGmtReq != null">
|
|
|
- AND DATE_FORMAT( a.gmt_req, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{tranLogPageVO.startGmtReq}, '%Y-%m-%d %T' )
|
|
|
+ AND DATE_FORMAT( a.gmt_req, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{tranLogPageVO.startGmtReq}, '%Y-%m-%d %T'
|
|
|
+ )
|
|
|
AND DATE_FORMAT(#{tranLogPageVO.endGmtReq}, '%Y-%m-%d %T' )
|
|
|
</if>
|
|
|
<if test="tranLogPageVO.startGmtResp != null and tranLogPageVO.endGmtResp != null">
|
|
|
- AND DATE_FORMAT( a.gmt_resp, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{tranLogPageVO.startGmtResp}, '%Y-%m-%d %T' )
|
|
|
+ AND DATE_FORMAT( a.gmt_resp, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{tranLogPageVO.startGmtResp}, '%Y-%m-%d
|
|
|
+ %T' )
|
|
|
AND DATE_FORMAT(#{tranLogPageVO.endGmtResp}, '%Y-%m-%d %T' )
|
|
|
</if>
|
|
|
<if test="tranLogPageVO.successFlag != null">
|
|
@@ -56,4 +61,23 @@
|
|
|
ORDER BY
|
|
|
a.gmt_modified DESC
|
|
|
</select>
|
|
|
+ <select id="getStatisDeptAlls" resultType="com.diagbot.dto.TranDeptLogDTO">
|
|
|
+ SELECT dept_name as deptName,
|
|
|
+ COUNT(*) as sums
|
|
|
+ FROM tran_log
|
|
|
+ WHERE is_deleted = "N"
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ AND hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName !=''">
|
|
|
+ AND dept_name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="startGmtReq != null and endGmtReq != null">
|
|
|
+ AND DATE_FORMAT( gmt_req, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{startGmtReq}, '%Y-%m-%d %T'
|
|
|
+ )
|
|
|
+ AND DATE_FORMAT(#{endGmtReq}, '%Y-%m-%d %T' )
|
|
|
+ </if>
|
|
|
+ GROUP BY dept_name order by sums desc
|
|
|
+
|
|
|
+ </select>
|
|
|
</mapper>
|