add(os-ems): 蒸汽报表增加计量设备名称筛选功能

- 在 EmsReportPointSteam 模型中添加 monitorName 字段
- 更新 SQL 查询以加入 monitor_name 的查询和筛选
- 优化查询语句,使用别名区分不同表的字段
- 添加 monitor_name 字段到结果映射
master
zch 7 months ago
parent 02da95585b
commit 4f67318363

@ -68,6 +68,12 @@ public class EmsReportPointSteam extends BaseEntity {
@Excel(name = "修改标识", readConverterExp = "0=是,1=否") @Excel(name = "修改标识", readConverterExp = "0=是,1=否")
private String updateFlag; private String updateFlag;
/** 计量设备名称 */
@Excel(name = "计量设备名称")
private String monitorName;
public void setObjId(Long objId) { public void setObjId(Long objId) {
this.objId = objId; this.objId = objId;
} }
@ -132,6 +138,15 @@ public class EmsReportPointSteam extends BaseEntity {
return updateFlag; return updateFlag;
} }
public String getMonitorName() {
return monitorName;
}
public void setMonitorName(String monitorName) {
this.monitorName = monitorName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -147,6 +162,7 @@ public class EmsReportPointSteam extends BaseEntity {
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("monitorName", getMonitorName())
.toString(); .toString();
} }
} }

@ -17,47 +17,51 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="monitorName" column="monitor_name"/>
</resultMap> </resultMap>
<sql id="selectEmsReportPointSteamVo"> <sql id="selectEmsReportPointSteamVo">
select obj_id, select erps.obj_id,
monitor_code, erps.monitor_code,
instrument_value, erps.instrument_value,
expend, erps.expend,
record_time, erps.record_time,
begin_time, erps.begin_time,
end_time, erps.end_time,
update_flag, erps.update_flag,
create_by, erps.create_by,
create_time, erps.create_time,
update_by, erps.update_by,
update_time erps.update_time,
from ems_report_point_steam ebm.monitor_name
from ems_report_point_steam erps
left join ems_base_monitor_info ebm on erps.monitor_code = ebm.monitor_code
</sql> </sql>
<select id="selectEmsReportPointSteamList" parameterType="EmsReportPointSteam" <select id="selectEmsReportPointSteamList" parameterType="EmsReportPointSteam"
resultMap="EmsReportPointSteamResult"> resultMap="EmsReportPointSteamResult">
<include refid="selectEmsReportPointSteamVo"/> <include refid="selectEmsReportPointSteamVo"/>
<where> <where>
<if test="monitorCode != null and monitorCode != ''">and monitor_code = #{monitorCode}</if> <if test="monitorCode != null and monitorCode != ''">and erps.monitor_code = #{monitorCode}</if>
<if test="instrumentValue != null ">and instrument_value = #{instrumentValue}</if> <if test="instrumentValue != null ">and erps.instrument_value = #{instrumentValue}</if>
<if test="expend != null ">and expend = #{expend}</if> <if test="expend != null ">and erps.expend = #{expend}</if>
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''"> <if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
and record_time between #{params.beginRecordTime} and #{params.endRecordTime} and erps.record_time between #{params.beginRecordTime} and #{params.endRecordTime}
</if> </if>
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''"> <if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
and begin_time between #{params.beginBeginTime} and #{params.endBeginTime} and erps.begin_time between #{params.beginBeginTime} and #{params.endBeginTime}
</if> </if>
<if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''"> <if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
and end_time between #{params.beginEndTime} and #{params.endEndTime} and erps.end_time between #{params.beginEndTime} and #{params.endEndTime}
</if> </if>
<if test="updateFlag != null and updateFlag != ''">and update_flag = #{updateFlag}</if> <if test="updateFlag != null and updateFlag != ''">and erps.update_flag = #{updateFlag}</if>
<if test="monitorName != null and monitorName != ''">and ebm.monitor_name like concat('%', #{monitorName}, '%')</if>
</where> </where>
</select> </select>
<select id="selectEmsReportPointSteamByObjId" parameterType="Long" resultMap="EmsReportPointSteamResult"> <select id="selectEmsReportPointSteamByObjId" parameterType="Long" resultMap="EmsReportPointSteamResult">
<include refid="selectEmsReportPointSteamVo"/> <include refid="selectEmsReportPointSteamVo"/>
where obj_id = #{objId} where erps.obj_id = #{objId}
</select> </select>
<insert id="insertEmsReportPointSteam" parameterType="EmsReportPointSteam" useGeneratedKeys="true" <insert id="insertEmsReportPointSteam" parameterType="EmsReportPointSteam" useGeneratedKeys="true"

Loading…
Cancel
Save