| | |
| | | <result column="area" jdbcType="VARCHAR" property="area" />
|
| | | <result column="monitorpoint" jdbcType="VARCHAR" property="monitorpoint" />
|
| | | <result column="owner_id" jdbcType="VARCHAR" property="ownerId" />
|
| | | <!-- 与省市县一对一的关系 -->
|
| | | <association property="monitorpointDetail" javaType="com.moral.monitor.entity.MonitorPoint">
|
| | | <result column="monitorpoint" property="id" jdbcType="VARCHAR" />
|
| | | <result column="mpt_name" property="name" jdbcType="VARCHAR" />
|
| | | </association>
|
| | | <association property="ownerDetail" javaType="com.moral.monitor.entity.Organization">
|
| | | <result column="owner_id" property="id" jdbcType="VARCHAR" />
|
| | | <result column="org_name" property="name" jdbcType="VARCHAR" />
|
| | | </association>
|
| | | <association property="installerDetail" javaType="com.moral.monitor.entity.User">
|
| | | <result column="installer" property="id" jdbcType="VARCHAR" />
|
| | | <result column="user_name" property="name" jdbcType="VARCHAR" />
|
| | | </association>
|
| | | </resultMap>
|
| | | <sql id="Example_Where_Clause">
|
| | | <where>
|
| | |
| | | <if test="distinct">
|
| | | distinct
|
| | | </if>
|
| | | <include refid="Base_Column_List" />
|
| | | equipment.*,
|
| | | mpt.name as mpt_name,
|
| | | org.name as org_name,
|
| | | user.name as user_name
|
| | | from equipment
|
| | | LEFT JOIN monitorpoint mpt on equipment.monitorpoint = mpt.id
|
| | | LEFT JOIN organization org on equipment.owner_id = org.id
|
| | | LEFT JOIN user on equipment.installer = user.id
|
| | | <if test="_parameter != null">
|
| | | <include refid="Example_Where_Clause" />
|
| | | </if>
|