辽宁版本台账管理调整

This commit is contained in:
2026-07-29 15:22:28 +08:00
parent c9bcfb1260
commit b940ad116e
2 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
<?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.njcn.device.pq.mapper.PqSubstationExpendMapper">
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.PqSubstationExpend">
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="LOAD_CAP" jdbcType="DECIMAL" property="loadCap" />
<result column="ADDRESS" jdbcType="VARCHAR" property="address" />
<result column="OPERATE_DATE" jdbcType="TIMESTAMP" property="operateDate" />
<result column="OPERATE_STATE" jdbcType="INTEGER" property="operateState" />
<result column="OWNER" jdbcType="VARCHAR" property="owner" />
<result column="PHONE_NO" jdbcType="VARCHAR" property="phoneNo" />
<result column="PLANT_TYPE" jdbcType="VARCHAR" property="plantType" />
<result column="REPORT_URL" jdbcType="VARCHAR" property="reportUrl" />
<result column="SORT" jdbcType="INTEGER" property="sort" />
</resultMap>
<resultMap id="VOResultMap" type="com.njcn.device.pq.pojo.vo.PqSubstationExpendVO">
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="LOAD_CAP" jdbcType="DECIMAL" property="loadCap" />
<result column="ADDRESS" jdbcType="VARCHAR" property="address" />
<result column="OPERATE_DATE" jdbcType="TIMESTAMP" property="operateDate" />
<result column="OPERATE_STATE" jdbcType="INTEGER" property="operateState" />
<result column="OWNER" jdbcType="VARCHAR" property="owner" />
<result column="PHONE_NO" jdbcType="VARCHAR" property="phoneNo" />
<result column="PLANT_TYPE" jdbcType="VARCHAR" property="plantType" />
<result column="REPORT_URL" jdbcType="VARCHAR" property="reportUrl" />
<result column="SORT" jdbcType="INTEGER" property="sort" />
<result column="CITY" jdbcType="VARCHAR" property="city" />
<result column="NAME" jdbcType="VARCHAR" property="name" />
</resultMap>
<sql id="joinClause">
INNER JOIN pq_substation s ON e.ID = s.id
INNER JOIN pq_line l3 ON s.id = l3.id AND l3.level = 3 AND l3.state = 1
LEFT JOIN pq_line l2 ON l3.pid = l2.id AND l2.state = 1
</sql>
<sql id="selectColumns">
e.*,
l2.name AS city,
l3.name AS name,
s.scale,
s.lng,
s.lat
</sql>
<sql id="whereClause">
<if test="param.id != null and param.id != ''">
AND e.ID = #{param.id}
</if>
<if test="param.name != null and param.name != ''">
AND l3.name LIKE '%' || #{param.name} || '%'
</if>
<if test="param.loadCap != null">
AND e.LOAD_CAP = #{param.loadCap}
</if>
<if test="param.address != null and param.address != ''">
AND e.ADDRESS LIKE '%' || #{param.address} || '%'
</if>
<if test="param.maxVoltageType != null">
AND e.MAX_VOLTAGE_TYPE = #{param.maxVoltageType}
</if>
<if test="param.operateDate != null">
AND e.OPERATE_DATE = #{param.operateDate}
</if>
<if test="param.operateState != null">
AND e.OPERATE_STATE = #{param.operateState}
</if>
<if test="param.owner != null and param.owner != ''">
AND e.OWNER LIKE '%' || #{param.owner} || '%'
</if>
<if test="param.phoneNo != null and param.phoneNo != ''">
AND e.PHONE_NO LIKE '%' || #{param.phoneNo} || '%'
</if>
<if test="param.plantType != null and param.plantType != ''">
AND e.PLANT_TYPE = #{param.plantType}
</if>
</sql>
<select id="pageJoin" resultMap="VOResultMap">
SELECT <include refid="selectColumns" />
FROM PQ_SUBSTATION_EXPEND e
<include refid="joinClause" />
WHERE 1=1
<include refid="whereClause" />
</select>
<select id="getByIdVO" resultMap="VOResultMap">
SELECT <include refid="selectColumns" />
FROM PQ_SUBSTATION_EXPEND e
<include refid="joinClause" />
WHERE e.ID = #{id}
</select>
<select id="listVO" resultMap="VOResultMap">
SELECT <include refid="selectColumns" />
FROM PQ_SUBSTATION_EXPEND e
<include refid="joinClause" />
</select>
</mapper>