fengxiang
2018-02-07 0723049b7785749898fede88452055a66c49770e
src/main/resources/mapper/DeviceMapper.xml
@@ -21,6 +21,7 @@
     </association>
     <association property="deviceVersion" javaType="com.moral.entity.DeviceVersion">
        <result column="device_version_id" property="id" jdbcType="INTEGER" />
        <result column="device_version_value" property="version" jdbcType="INTEGER" />
        <result column="device_version_name" property="name" jdbcType="VARCHAR" />
     </association>
     <association property="monitorPoint" javaType="com.moral.entity.MonitorPoint">
@@ -133,8 +134,9 @@
      AND device_version_id = #{deviceVersionId}
   </select>
   <select id="selectByOrgIdAndDevName" resultMap="BaseResultMap">
      SELECT * from device dev
      SELECT dev.*,dve.version as device_version_value from device dev
      left join monitor_point mpt on dev.monitor_point_id = mpt.id
      left join device_version dve on dev.device_version_id = dve.id
      <where>
         <if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)">
            mpt.organization_id =  #{orgId}
@@ -145,8 +147,9 @@
      </where>
   </select>
   <select id="selectByOrgIdAndMpId" resultMap="BaseResultMap">
      SELECT * from device dev
      SELECT dev.*,dve.version as device_version_value from device dev
      left join monitor_point mpt on dev.monitor_point_id = mpt.id
      left join device_version dve on dev.device_version_id = dve.id
      <where>
         <if test="@com.moral.common.bean.Constants@isNotSpecialOrgId(orgId)">
            mpt.organization_id =  #{orgId}