|
|
@@ -26,25 +26,25 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
- substation_id,
|
|
|
- dept_id,
|
|
|
- dept_name,
|
|
|
- line_id,
|
|
|
- line_name,
|
|
|
- work_area,
|
|
|
- substation_name,
|
|
|
- order_num,
|
|
|
- marker,
|
|
|
- longitude,
|
|
|
- latitude,
|
|
|
- substation_group,
|
|
|
- substation_duty,
|
|
|
- substation_state,
|
|
|
- del_flag,
|
|
|
- create_by,
|
|
|
- create_time,
|
|
|
- update_by,
|
|
|
- update_time
|
|
|
+ t.substation_id,
|
|
|
+ t.dept_id,
|
|
|
+ v.dept_name,
|
|
|
+ t.line_id,
|
|
|
+ v.line_name,
|
|
|
+ t.work_area,
|
|
|
+ t.substation_name,
|
|
|
+ t.order_num,
|
|
|
+ t.marker,
|
|
|
+ t.longitude,
|
|
|
+ t.latitude,
|
|
|
+ t.substation_group,
|
|
|
+ t.substation_duty,
|
|
|
+ t.substation_state,
|
|
|
+ t.del_flag,
|
|
|
+ t.create_by,
|
|
|
+ t.create_time,
|
|
|
+ t.update_by,
|
|
|
+ t.update_time
|
|
|
</sql>
|
|
|
|
|
|
<insert id="insert" parameterType="com.railway.business.baseinfo.domain.BusSubstation">
|
|
|
@@ -56,15 +56,9 @@
|
|
|
<if test='null != deptId'>
|
|
|
dept_id,
|
|
|
</if>
|
|
|
- <if test='null != deptName'>
|
|
|
- dept_name,
|
|
|
- </if>
|
|
|
<if test='null != lineId'>
|
|
|
line_id,
|
|
|
</if>
|
|
|
- <if test='null != lineName'>
|
|
|
- line_name,
|
|
|
- </if>
|
|
|
<if test='null != workArea'>
|
|
|
work_area,
|
|
|
</if>
|
|
|
@@ -112,15 +106,9 @@
|
|
|
<if test='null != deptId'>
|
|
|
#{deptId},
|
|
|
</if>
|
|
|
- <if test='null != deptName'>
|
|
|
- #{deptName},
|
|
|
- </if>
|
|
|
<if test='null != lineId'>
|
|
|
#{lineId},
|
|
|
</if>
|
|
|
- <if test='null != lineName'>
|
|
|
- #{lineName},
|
|
|
- </if>
|
|
|
<if test='null != workArea'>
|
|
|
#{workArea},
|
|
|
</if>
|
|
|
@@ -176,9 +164,7 @@
|
|
|
UPDATE base_substation
|
|
|
<set>
|
|
|
<if test='null != deptId'>dept_id = #{deptId},</if>
|
|
|
- <if test='null != deptName'>dept_name = #{deptName},</if>
|
|
|
<if test='null != lineId'>line_id = #{lineId},</if>
|
|
|
- <if test='null != lineName'>line_name = #{lineName},</if>
|
|
|
<if test='null != workArea'>work_area = #{workArea},</if>
|
|
|
<if test='null != substationName'>substation_name = #{substationName},</if>
|
|
|
<if test='null != orderNum'>order_num = #{orderNum},</if>
|
|
|
@@ -189,8 +175,6 @@
|
|
|
<if test='null != substationDuty'>substation_duty = #{substationDuty},</if>
|
|
|
<if test='null != substationState'>substation_state = #{substationState},</if>
|
|
|
<if test='null != delFlag'>del_flag = #{delFlag},</if>
|
|
|
- <if test='null != createBy'>create_by = #{createBy},</if>
|
|
|
- <if test='null != createTime'>create_time = #{createTime},</if>
|
|
|
<if test='null != updateBy'>update_by = #{updateBy},</if>
|
|
|
<if test='null != updateTime'>update_time = #{updateTime}</if>
|
|
|
</set>
|
|
|
@@ -201,70 +185,59 @@
|
|
|
<select id="getInfo" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
|
- FROM base_substation
|
|
|
- WHERE del_flag='0' and substation_id = #{substationId}
|
|
|
-
|
|
|
+ FROM base_substation t
|
|
|
+ LEFT JOIN v_substation v on t.substation_id = v.substation_id
|
|
|
+ WHERE t.del_flag='0' and t.substation_id = #{substationId}
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
|
- FROM base_substation
|
|
|
+ FROM base_substation t
|
|
|
+ LEFT JOIN v_substation v on t.substation_id = v.substation_id
|
|
|
<where>
|
|
|
- del_flag='0'
|
|
|
+ t.del_flag='0'
|
|
|
<if test="deptId!=null and deptId!=''">
|
|
|
- and dept_id=#{deptId}
|
|
|
+ and t.dept_id=#{deptId}
|
|
|
</if>
|
|
|
<if test="deptName!=null and deptName!=''">
|
|
|
- and dept_name=#{deptName}
|
|
|
+ and v.dept_name=#{deptName}
|
|
|
</if>
|
|
|
<if test="lineId!=null and lineId!=''">
|
|
|
- and line_id=#{lineId}
|
|
|
+ and t.line_id=#{lineId}
|
|
|
</if>
|
|
|
<if test="lineName!=null and lineName!=''">
|
|
|
- and line_name=#{lineName}
|
|
|
+ and v.line_name=#{lineName}
|
|
|
</if>
|
|
|
<if test="workArea!=null and workArea!=''">
|
|
|
- and work_area=#{workArea}
|
|
|
+ and t.work_area=#{workArea}
|
|
|
</if>
|
|
|
<if test="substationName!=null and substationName!=''">
|
|
|
- and substation_name=#{substationName}
|
|
|
+ and t.substation_name=#{substationName}
|
|
|
</if>
|
|
|
<if test="orderNum!=null and orderNum!=''">
|
|
|
- and order_num=#{orderNum}
|
|
|
+ and t.order_num=#{orderNum}
|
|
|
</if>
|
|
|
<if test="marker!=null and marker!=''">
|
|
|
- and marker=#{marker}
|
|
|
+ and t.marker=#{marker}
|
|
|
</if>
|
|
|
<if test="longitude!=null and longitude!=''">
|
|
|
- and longitude=#{longitude}
|
|
|
+ and t.longitude=#{longitude}
|
|
|
</if>
|
|
|
<if test="latitude!=null and latitude!=''">
|
|
|
- and latitude=#{latitude}
|
|
|
+ and t.latitude=#{latitude}
|
|
|
</if>
|
|
|
<if test="substationGroup!=null and substationGroup!=''">
|
|
|
- and substation_group=#{substationGroup}
|
|
|
+ and t.substation_group=#{substationGroup}
|
|
|
</if>
|
|
|
<if test="substationDuty!=null and substationDuty!=''">
|
|
|
- and substation_duty=#{substationDuty}
|
|
|
+ and t.substation_duty=#{substationDuty}
|
|
|
</if>
|
|
|
<if test="substationState!=null and substationState!=''">
|
|
|
- and substation_state=#{substationState}
|
|
|
+ and t.substation_state=#{substationState}
|
|
|
</if>
|
|
|
<if test="delFlag!=null and delFlag!=''">
|
|
|
- and del_flag=#{delFlag}
|
|
|
- </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}
|
|
|
+ and t.del_flag=#{delFlag}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|