Ver código fonte

规避pgsql bool类型问题

wanghs 2 anos atrás
pai
commit
29f771338f

+ 19 - 5
warning-web/src/main/resources/mappers-postgresql/Alertrule2Mapper.xml

@@ -25,14 +25,14 @@
         <result column="taskstart" property="taskstart"/>
         <result column="relatedParts" property="relatedParts"/>
     </resultMap>
-    <resultMap type="Alertrule2" id="Alertrule2Result">
+    <resultMap type="com.gyee.wisdom.alarm.sharding.entity.Alertrule2" id="Alertrule2Result">
         <result property="id" column="id"/>
         <result property="name" column="name"/>
         <result property="station" column="station"/>
         <result property="relatedParts" column="relatedParts"/>
-        <association property="windPowerStation" column="station" javaType="WindPowerStation"
+        <association property="windPowerStation" column="station" javaType="com.gyee.wisdom.alarm.sharding.entity.WindPowerStation"
                      select="com.gyee.wisdom.alarm.sharding.mapper.WindPowerStationMapper.selectByid"/>
-        <association property="datadictionary" column="relatedParts" javaType="Datadictionary"
+        <association property="datadictionary" column="relatedParts" javaType="com.gyee.wisdom.alarm.sharding.entity.Datadictionary"
                      select="com.gyee.wisdom.alarm.sharding.mapper.DatadictionaryMapper.selectBycode"/>
     </resultMap>
 
@@ -55,9 +55,9 @@
         <result property="electrical" column="electrical"/>
         <result property="taskstart" column="taskstart"/>
         <result property="relatedParts" column="relatedParts"/>
-        <association property="windPowerStation" column="station" javaType="WindPowerStation"
+        <association property="windPowerStation" column="station" javaType="com.gyee.wisdom.alarm.sharding.entity.WindPowerStation"
                      select="com.gyee.wisdom.alarm.sharding.mapper.WindPowerStationMapper.selectByid"/>
-        <association property="datadictionary" column="relatedParts" javaType="Datadictionary"
+        <association property="datadictionary" column="relatedParts" javaType="com.gyee.wisdom.alarm.sharding.entity.Datadictionary"
                      select="com.gyee.wisdom.alarm.sharding.mapper.DatadictionaryMapper.selectBycode"/>
     </resultMap>
 
@@ -96,6 +96,20 @@
 
     </select>
 
+    <select id="getAllByStationIdAndModelId2" parameterType="java.util.Map"
+            resultMap="alertRule2ResultToPostgreSql">
+        select a.*, (case a.enabled   WHEN 't' then 1  when 'f' then 0  else 0 end) as specialenable from  ALERTRULE2 a
+        <where>
+            1=1
+            <if test="station !=null and station !=''">
+                and a.station = #{station}
+            </if>
+            <if test="modelid !=null and modelid !=''">
+                and a.modelid = #{modelid}
+            </if>
+        </where>
+    </select>
+
     <select id="getMaxEdnaValue" parameterType="java.util.Map" resultType="java.lang.Integer">
         select max(a.ednavalue) from ALERTRULE2 a
     </select>