<?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.sinata.system.mapper.MwMicroEquipmentMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.sinata.system.domain.MwMicroEquipment">
|
<id column="ID" property="id" />
|
<result column="DEL_FLAG" property="delFlag" />
|
<result column="CREATE_BY" property="createBy" />
|
<result column="CREATE_TIME" property="createTime" />
|
<result column="UPDATE_BY" property="updateBy" />
|
<result column="UPDATE_TIME" property="updateTime" />
|
<result column="DEPARTMENT_ID" property="departmentId" />
|
<result column="EQUIPMENT_NAME" property="equipmentName" />
|
<result column="EQUIPMENT_NUMBER" property="equipmentNumber" />
|
<result column="STATUS" property="status" />
|
<result column="REMARK" property="remark" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
DEL_FLAG,
|
CREATE_BY,
|
CREATE_TIME,
|
UPDATE_BY,
|
UPDATE_TIME,
|
ID, DEPARTMENT_ID, EQUIPMENT_NAME, EQUIPMENT_NUMBER, STATUS, REMARK
|
</sql>
|
<select id="pageList" resultType="com.sinata.system.domain.vo.MwMicroEquipmentVO">
|
SELECT mme.ID,
|
mme.DEPARTMENT_ID,
|
mme.EQUIPMENT_NAME,
|
mme.EQUIPMENT_NUMBER,
|
mme.STATUS,
|
mme.REMARK,
|
mme.RELATION,
|
SD.DEPARTMENT_NAME AS hospitalName
|
FROM MW_MICRO_EQUIPMENT mme
|
LEFT JOIN SYS_DEPARTMENT sd ON SD.ID = mme.DEPARTMENT_ID
|
<where>
|
mme.DEL_FLAG = 0
|
<if test="treeCode != null and treeCode != ''">
|
AND sd.TREE_CODE LIKE concat(#{treeCode}, '%')
|
</if>
|
<if test="equipmentName != null and equipmentName != ''">
|
AND mme.EQUIPMENT_NAME LIKE concat('%',#{equipmentName},'%')
|
</if>
|
<if test="equipmentNumber != null and equipmentNumber != ''">
|
AND mme.EQUIPMENT_NUMBER LIKE concat('%',#{equipmentNumber},'%')
|
</if>
|
<if test="status!= null">
|
AND mme.STATUS = #{status}
|
</if>
|
</where>
|
ORDER BY mme.CREATE_TIME DESC
|
</select>
|
<select id="storedMedicalWastePage" resultType="com.sinata.system.domain.vo.MwMedicalWasteBoxVO">
|
SELECT mcr.BOX_ID AS id,
|
mcr.HOSPITAL_NAME,
|
mcr.MEDICAL_WASTE_NUMBER,
|
mcr.BOX_NUMBER,
|
mcr.WASTE_TYPE_STR,
|
mcr.COLLECT_TIME,
|
su.NICK_NAME AS COLLECT_USER_NAME,
|
msr.ROOM_NAME,
|
COUNT(*) AS bagNum,
|
SUM(mcr.WEIGHT) AS totalWeight
|
FROM MW_COLLECT_RECORD mcr
|
LEFT JOIN SYS_USER su
|
ON mcr.COLLECT_USER_ID = su.USER_ID
|
LEFT JOIN SYS_DEPARTMENT sd ON su.DEPARTMENT_ID = sd.ID
|
LEFT JOIN MW_STAGING_ROOM msr ON msr.ID = mcr.STAGING_ROOM_ID
|
<where>
|
mcr.STATUS = 1 AND mcr.DEL_FLAG = 0
|
<if test="treeCode != null and treeCode != ''">
|
and sd.TREE_CODE like concat(#{treeCode},'%')
|
</if>
|
<if test="query.stagingRoomId != null and query.stagingRoomId != ''">
|
and mcr.STAGING_ROOM_ID = #{query.stagingRoomId}
|
</if>
|
<if test="query.wasteType != null">
|
and mcr.WASTE_TYPE = #{query.wasteType}
|
</if>
|
<if test="query.collectTimeStart != null and query.collectTimeEnd != null">
|
and mcr.COLLECT_TIME between #{query.collectTimeStart} and #{query.collectTimeEnd}
|
</if>
|
</where>
|
GROUP BY mcr.BOX_ID
|
ORDER BY mcr.CREATE_TIME DESC
|
</select>
|
|
</mapper>
|