Browse Source

【CHG】记录故障关联基础表查询返回相应中文。

hao 4 years ago
parent
commit
993dd8ef5a

+ 9 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/BusJlgz.java

@@ -21,6 +21,12 @@ public class BusJlgz extends BaseEntity{
     @ApiModelProperty(value = "主键")
     private String id;
 
+    @ApiModelProperty(value = "线别名称")
+    private String lineName;
+
+    @ApiModelProperty(value = "所别名称")
+    private String substationName;
+
     @ApiModelProperty(value = "线别")
     @Length(min = 1, max = 100, message = "【线别】长度必须介于 {min} 和 {max} 之间")
     private String xb;
@@ -40,6 +46,9 @@ public class BusJlgz extends BaseEntity{
     @Length(min = 1, max = 100, message = "【原因类型】长度必须介于 {min} 和 {max} 之间")
     private String yylx;
 
+    @ApiModelProperty(value = "原因类型中文")
+    private String yylxText;
+
     @ApiModelProperty(value = "记录日期")
     @Length(min = 1, max = 100, message = "【记录日期】长度必须介于 {min} 和 {max} 之间")
     private String jlrq;

+ 68 - 44
railway-business/src/main/resources/mapper/business/BusJlgzMapper.xml

@@ -17,6 +17,9 @@
                 <result column="update_by" property="updateBy"/>
                 <result column="update_time" property="updateTime"/>
                 <result column="del_flag" property="delFlag"/>
+                <result column="line_name" property="lineName"/>
+                <result column="substation_name" property="substationName"/>
+                <result column="yylx_text" property="yylxText"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -146,56 +149,77 @@
 
     <select id="getInfo" resultMap="BaseResultMap">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM bus_jlgz
-        WHERE del_flag='0' and id = #{id}
-
+            line.line_name,
+            sub.substation_name,
+            dict.dict_label as yylx_text,
+            a.*
+        FROM
+            bus_jlgz a
+        LEFT JOIN bus_line line ON a.xb = line.line_id
+        LEFT JOIN bus_substation sub ON a.sb = sub.substation_id
+        LEFT JOIN sys_dict_data dict on a.yylx = dict.dict_value
+        WHERE
+            a.del_flag = '0'
+            AND line.del_flag = '0'
+            AND sub.del_flag = '0'
+            AND dict.dict_type = 'gzyy'
+            AND a.id = #{id}
     </select>
 
     <select id="getList" resultMap="BaseResultMap">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM bus_jlgz
+            line.line_name,
+            sub.substation_name,
+            dict.dict_label as yylx_text,
+            a.*
+        FROM
+            bus_jlgz a
+        LEFT JOIN bus_line line ON a.xb = line.line_id
+        LEFT JOIN bus_substation sub ON a.sb = sub.substation_id
+        LEFT JOIN sys_dict_data dict on a.yylx = dict.dict_value
         <where>
-            del_flag='0'
-                <if test="xb!=null and xb!=''">
-                    and xb=#{xb}
-                </if>
-                <if test="sb!=null and sb!=''">
-                    and sb=#{sb}
-                </if>
-                <if test="hb!=null and hb!=''">
-                    and hb=#{hb}
-                </if>
-                <if test="glb!=null and glb!=''">
-                    and glb=#{glb}
-                </if>
-                <if test="yylx!=null and yylx!=''">
-                    and yylx=#{yylx}
-                </if>
-                <if test="jlrq!=null and jlrq!=''">
-                    and jlrq=#{jlrq}
-                </if>
-                <if test="gzms!=null and gzms!=''">
-                    and gzms=#{gzms}
-                </if>
-                <if test="createBy!=null and createBy!=''">
-                    and create_by=#{createBy}
-                </if>
-                <if test="createTime!=null and createTime!=''">
-                    and create_time=#{createTime}
-                </if>
-                <if test="updateBy!=null and updateBy!=''">
-                    and update_by=#{updateBy}
-                </if>
-                <if test="updateTime!=null and updateTime!=''">
-                    and update_time=#{updateTime}
-                </if>
-                <if test="delFlag!=null and delFlag!=''">
-                    and del_flag=#{delFlag}
-                </if>
+            a.del_flag = '0'
+            AND line.del_flag = '0'
+            AND sub.del_flag = '0'
+            AND dict.dict_type = 'gzyy'
+            <if test="xb!=null and xb!=''">
+                and a.xb=#{xb}
+            </if>
+            <if test="sb!=null and sb!=''">
+                and a.sb=#{sb}
+            </if>
+            <if test="hb!=null and hb!=''">
+                and a.hb=#{hb}
+            </if>
+            <if test="glb!=null and glb!=''">
+                and a.glb=#{glb}
+            </if>
+            <if test="yylx!=null and yylx!=''">
+                and a.yylx=#{yylx}
+            </if>
+            <if test="jlrq!=null and jlrq!=''">
+                and a.jlrq=#{jlrq}
+            </if>
+            <if test="gzms!=null and gzms!=''">
+                and a.gzms=#{gzms}
+            </if>
+            <if test="createBy!=null and createBy!=''">
+                and a.create_by=#{createBy}
+            </if>
+            <if test="createTime!=null and createTime!=''">
+                and a.create_time=#{createTime}
+            </if>
+            <if test="updateBy!=null and updateBy!=''">
+                and a.update_by=#{updateBy}
+            </if>
+            <if test="updateTime!=null and updateTime!=''">
+                and a.update_time=#{updateTime}
+            </if>
+            <if test="delFlag!=null and delFlag!=''">
+                and a.del_flag=#{delFlag}
+            </if>
         </where>
-        order by jlrq desc
+        order by a.jlrq desc
     </select>
 
 </mapper>