<?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.MwProtectionEquipmentRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.sinata.system.domain.MwProtectionEquipmentRecord">
|
<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="PROTECTION_EQUIPMENT_ID" property="protectionEquipmentId" />
|
<result column="CHANGE_QUANTITY" property="changeQuantity" />
|
<result column="TYPE" property="type" />
|
<result column="OPERATOR" property="operator" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
DEL_FLAG,
|
CREATE_BY,
|
CREATE_TIME,
|
UPDATE_BY,
|
UPDATE_TIME,
|
ID, PROTECTION_EQUIPMENT_ID, CHANGE_QUANTITY, TYPE, OPERATOR
|
</sql>
|
<select id="findByEquipmentIdAndUsageTimeAfter"
|
resultType="com.sinata.system.domain.vo.MwProtectionEquipmentRecordVO">
|
SELECT MPER.ID,
|
MPER.PROTECTION_EQUIPMENT_ID,
|
MPER.CHANGE_QUANTITY,
|
MPER.TYPE,
|
MPER.OPERATOR,
|
MPER.CREATE_TIME,
|
MPER.REMARK,
|
MPE.EQUIPMENT_NAME,
|
SD.DEPARTMENT_NAME
|
FROM MW_PROTECTION_EQUIPMENT_RECORD MPER
|
LEFT JOIN MW_PROTECTION_EQUIPMENT MPE ON MPE.ID = MPER.PROTECTION_EQUIPMENT_ID
|
LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MPE.DEPARTMENT_ID
|
<where>
|
MPE.DEL_FLAG = 0
|
AND MPER.PROTECTION_EQUIPMENT_ID = #{id}
|
AND MPER.CREATE_TIME >= SYSDATE - INTERVAL '1' MONTH -- 最近一个月
|
ORDER BY CREATE_TIME DESC
|
</where>
|
|
|
</select>
|
|
</mapper>
|