|
|
|
@ -32,47 +32,97 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="LimitID" column="LimitID" />
|
|
|
|
|
<result property="ImageUrl" column="ImageUrl" />
|
|
|
|
|
<result property="LineID" column="LineID" />
|
|
|
|
|
<association property="stationtype" column="StationName" javaType="com.ruoyi.nanjing.domain.TBdStationtype" resultMap="stationtp"/>
|
|
|
|
|
<association property="linetype" column="LineTypeName" javaType="com.ruoyi.nanjing.domain.TBdLinetype" resultMap="lineName"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap id="lineName" type="com.ruoyi.nanjing.domain.TBdLinetype">
|
|
|
|
|
<result property="LineID" column="LineID" />
|
|
|
|
|
<result property="LineTypeName" column="LineTypeName" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap id="stationtp" type="com.ruoyi.nanjing.domain.TBdStationtype">
|
|
|
|
|
<result property="ID" column="ID" />
|
|
|
|
|
<result property="typeName" column="Type_Name" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectTBdSubstationVo">
|
|
|
|
|
select ID, StationID, StationCode, StationType, MachineID, UniteID, CustomerCode, StationName, ParentStationID, ParentStationCode, ParentStationName, PreStationID, PreStationCode, Reamark, UserID, UpdateTime, TableName, IsSemi, IsNGStation, HaveData, IsShow, UseFlag, paraCount, OrderID, LimitID, ImageUrl, LineID from T_BD_SubStation
|
|
|
|
|
select t1.ID,t1.StationID, t1.StationCode, t1.StationType, t1.MachineID, t1.UniteID,
|
|
|
|
|
t1.CustomerCode, t1.StationName, t1.ParentStationID, t1.ParentStationCode, t1.ParentStationName,
|
|
|
|
|
t1.PreStationID, t1.PreStationCode, t1.Reamark, t1.UserID, t1.UpdateTime, t1.TableName, t1.IsSemi,
|
|
|
|
|
t1.IsNGStation, t1.HaveData, t1.IsShow, t1.UseFlag, t1.paraCount, t1.OrderID,t1.LimitID, t1.ImageUrl, t1.LineID,
|
|
|
|
|
t2.LineTypeName,t3.Type_Name from T_BD_SubStation t1
|
|
|
|
|
left join T_BD_LineType t2 on t1.LineID = t2.LineID
|
|
|
|
|
left join T_BD_StationType t3 on t1.StationType = t3.ID
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectStationcode" resultMap="TBdSubstationResult">
|
|
|
|
|
select top 1 * from T_BD_SubStation order by StationID desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOrderid" resultMap="TBdSubstationResult">
|
|
|
|
|
select top 1 * from T_BD_SubStation order by OrderID desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="createTable" parameterType="map" statementType="CALLABLE" resultMap="TBdSubstationResult">
|
|
|
|
|
{
|
|
|
|
|
call SP_SY_CreatStationTableByStationCode(
|
|
|
|
|
#{tableName,mode=IN,jdbcType=VARCHAR},
|
|
|
|
|
#{ParaAmount,mode=IN,jdbcType=BIGINT}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateTable" parameterType="map" statementType="CALLABLE">
|
|
|
|
|
{
|
|
|
|
|
call SP_Pro_UpdateParaTable(
|
|
|
|
|
#{paraCount,mode=IN,jdbcType=BIGINT},
|
|
|
|
|
#{tableName,mode=IN,jdbcType=VARCHAR},
|
|
|
|
|
#{stationID,mode=IN,jdbcType=BIGINT}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</update>
|
|
|
|
|
<delete id="deletePara" parameterType="map" statementType="CALLABLE">
|
|
|
|
|
{
|
|
|
|
|
call SP_Pro_DeleteStationPara(
|
|
|
|
|
#{stationID,mode=IN,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</delete>
|
|
|
|
|
<select id="selectTBdSubstationList" parameterType="TBdSubstation" resultMap="TBdSubstationResult">
|
|
|
|
|
<include refid="selectTBdSubstationVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="StationID != null "> and StationID = #{StationID}</if>
|
|
|
|
|
<if test="StationCode != null and StationCode != ''"> and StationCode = #{StationCode}</if>
|
|
|
|
|
<if test="StationType != null "> and StationType = #{StationType}</if>
|
|
|
|
|
<if test="MachineID != null and MachineID != ''"> and MachineID = #{MachineID}</if>
|
|
|
|
|
<if test="UniteID != null "> and UniteID = #{UniteID}</if>
|
|
|
|
|
<if test="CustomerCode != null and CustomerCode != ''"> and CustomerCode = #{CustomerCode}</if>
|
|
|
|
|
<if test="StationName != null "> and StationName like ('%' + #{StationName} + '%')</if>
|
|
|
|
|
<if test="ParentStationID != null and ParentStationID != ''"> and ParentStationID = #{ParentStationID}</if>
|
|
|
|
|
<if test="ParentStationCode != null and ParentStationCode != ''"> and ParentStationCode = #{ParentStationCode}</if>
|
|
|
|
|
<if test="ParentStationName != null "> and ParentStationName like ('%' + #{ParentStationName} + '%')</if>
|
|
|
|
|
<if test="PreStationID != null and PreStationID != ''"> and PreStationID = #{PreStationID}</if>
|
|
|
|
|
<if test="PreStationCode != null and PreStationCode != ''"> and PreStationCode = #{PreStationCode}</if>
|
|
|
|
|
<if test="Reamark != null "> and Reamark = #{Reamark}</if>
|
|
|
|
|
<if test="UserID != null and UserID != ''"> and UserID = #{UserID}</if>
|
|
|
|
|
<if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
|
|
|
|
|
<if test="TableName != null "> and TableName like ('%' + #{TableName} + '%')</if>
|
|
|
|
|
<if test="IsSemi != null and IsSemi != ''"> and IsSemi = #{IsSemi}</if>
|
|
|
|
|
<if test="IsNGStation != null and IsNGStation != ''"> and IsNGStation = #{IsNGStation}</if>
|
|
|
|
|
<if test="HaveData != null and HaveData != ''"> and HaveData = #{HaveData}</if>
|
|
|
|
|
<if test="IsShow != null and IsShow != ''"> and IsShow = #{IsShow}</if>
|
|
|
|
|
<if test="UseFlag != null and UseFlag != ''"> and UseFlag = #{UseFlag}</if>
|
|
|
|
|
<if test="paraCount != null "> and paraCount = #{paraCount}</if>
|
|
|
|
|
<if test="OrderID != null "> and OrderID = #{OrderID}</if>
|
|
|
|
|
<if test="LimitID != null and LimitID != ''"> and LimitID = #{LimitID}</if>
|
|
|
|
|
<if test="ImageUrl != null "> and ImageUrl = #{ImageUrl}</if>
|
|
|
|
|
<if test="LineID != null "> and LineID = #{LineID}</if>
|
|
|
|
|
<if test="StationID != null "> and t1.StationID = #{StationID}</if>
|
|
|
|
|
<if test="StationCode != null and StationCode != ''"> and t1.StationCode = #{StationCode}</if>
|
|
|
|
|
<if test="StationType != null "> and t1.StationType = #{StationType}</if>
|
|
|
|
|
<if test="MachineID != null and MachineID != ''"> and t1.MachineID = #{MachineID}</if>
|
|
|
|
|
<if test="UniteID != null "> and t1.UniteID = #{UniteID}</if>
|
|
|
|
|
<if test="CustomerCode != null and CustomerCode != ''"> and t1.CustomerCode = #{CustomerCode}</if>
|
|
|
|
|
<if test="StationName != null "> and t1.StationName like ('%' + #{StationName} + '%')</if>
|
|
|
|
|
<if test="ParentStationID != null and ParentStationID != ''"> and t1.ParentStationID = #{ParentStationID}</if>
|
|
|
|
|
<if test="ParentStationCode != null and ParentStationCode != ''"> and t1.ParentStationCode = #{ParentStationCode}</if>
|
|
|
|
|
<if test="ParentStationName != null "> and t1.ParentStationName like ('%' + #{ParentStationName} + '%')</if>
|
|
|
|
|
<if test="PreStationID != null and PreStationID != ''"> and t1.PreStationID = #{PreStationID}</if>
|
|
|
|
|
<if test="PreStationCode != null and PreStationCode != ''"> and t1.PreStationCode = #{PreStationCode}</if>
|
|
|
|
|
<if test="Reamark != null "> and t1.Reamark = #{Reamark}</if>
|
|
|
|
|
<if test="UserID != null and UserID != ''"> and t1.UserID = #{UserID}</if>
|
|
|
|
|
<if test="UpdateTime != null "> and t1.UpdateTime = #{UpdateTime}</if>
|
|
|
|
|
<if test="TableName != null "> and t1.TableName like ('%' + #{TableName} + '%')</if>
|
|
|
|
|
<if test="IsSemi != null and IsSemi != ''"> and t1.IsSemi = #{IsSemi}</if>
|
|
|
|
|
<if test="IsNGStation != null and IsNGStation != ''"> and t1.IsNGStation = #{IsNGStation}</if>
|
|
|
|
|
<if test="HaveData != null and HaveData != ''"> and t1.HaveData = #{HaveData}</if>
|
|
|
|
|
<if test="IsShow != null and IsShow != ''"> and t1.IsShow = #{IsShow}</if>
|
|
|
|
|
<if test="UseFlag != null and UseFlag != ''"> and t1.UseFlag = #{UseFlag}</if>
|
|
|
|
|
<if test="paraCount != null "> and t1.paraCount = #{paraCount}</if>
|
|
|
|
|
<if test="OrderID != null "> and t1.OrderID = #{OrderID}</if>
|
|
|
|
|
<if test="LimitID != null and LimitID != ''"> and t1.LimitID = #{LimitID}</if>
|
|
|
|
|
<if test="ImageUrl != null "> and t1.ImageUrl = #{ImageUrl}</if>
|
|
|
|
|
<if test="LineID != null "> and t1.LineID = #{LineID}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectTBdSubstationById" parameterType="Long" resultMap="TBdSubstationResult">
|
|
|
|
|
<include refid="selectTBdSubstationVo"/>
|
|
|
|
|
where ID = #{ID}
|
|
|
|
|
where t1.ID = #{ID}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertTBdSubstation" parameterType="TBdSubstation">
|
|
|
|
|