1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?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.diagbot.mapper.TranLogMapper">
- <!-- 通用查询映射结果 -->
- <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"/>
- </resultMap>
- <select id="getPage" resultType="com.diagbot.entity.TranLog">
- SELECT
- *
- FROM
- tran_log a
- WHERE
- a.is_deleted = 'N'
- <if test="tranLogPageVO.hospitalId != null">
- AND a.hospital_id = #{tranLogPageVO.hospitalId}
- </if>
- <if test="tranLogPageVO.deptName != null and tranLogPageVO.deptName !=''">
- AND a.dept_name = #{tranLogPageVO.deptName}
- </if>
- <if test="tranLogPageVO.patientId != null and tranLogPageVO.patientId != ''">
- AND a.patient_id LIKE CONCAT( '%', #{tranLogPageVO.patientId}, '%' )
- </if>
- <if test="tranLogPageVO.sceneName != null and tranLogPageVO.sceneName != ''">
- AND a.scene_name LIKE CONCAT( '%', #{tranLogPageVO.sceneName}, '%' )
- </if>
- <if test="tranLogPageVO.subHospitalName != null and tranLogPageVO.subHospitalName != ''">
- 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(#{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(#{tranLogPageVO.endGmtResp}, '%Y-%m-%d %T' )
- </if>
- <if test="tranLogPageVO.successFlag != null">
- AND a.success_flag = #{tranLogPageVO.successFlag}
- </if>
- 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 = #{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>
|