<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<mapper namespace="com.gk.hotwork.Mapper.SafetyInspectionItemMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetyInspectionItem" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="valid_flag" property="validFlag" jdbcType="TINYINT" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
|
|
<result column="element_a" property="elementA" jdbcType="BIGINT" />
|
<result column="element_b" property="elementB" jdbcType="BIGINT" />
|
<result column="standardization_requirements" property="standardizationRequirements" jdbcType="VARCHAR" />
|
<result column="enterprise_standard" property="enterpriseStandard" jdbcType="VARCHAR" />
|
<result column="review_method" property="reviewMethod" jdbcType="VARCHAR" />
|
<result column="veto" property="veto" jdbcType="VARCHAR" />
|
<result column="element_a_name" property="elementAName" jdbcType="VARCHAR" />
|
<result column="element_b_name" property="elementBName" jdbcType="VARCHAR" />
|
|
</resultMap>
|
<select id="selectPages" resultMap="BaseResultMap">
|
select a.*,
|
b.name element_a_name,
|
c.name element_b_name
|
from safety_inspection_item as a
|
left join element_management as b on a.element_a = b.id and b.valid_flag = 1
|
left join element_management as c on a.element_b = c.id and c.valid_flag = 1
|
where a.valid_flag = 1 and a.element_b= #{params.elementB}
|
</select>
|
|
<select id="infoElementA" resultMap="BaseResultMap">
|
select a.*,
|
b.name element_a_name,
|
c.name element_b_name
|
from safety_inspection_item as a
|
left join element_management as b on a.element_a = b.id and b.valid_flag = 1
|
left join element_management as c on a.element_b = c.id and c.valid_flag = 1
|
where a.valid_flag = 1 and a.element_a= #{id}
|
</select>
|
|
|
<select id="getById" resultMap="BaseResultMap">
|
select a.*,
|
b.name element_a_name,
|
c.name element_b_name
|
from safety_inspection_item as a
|
left join element_management as b on a.element_a = b.id and b.valid_flag = 1
|
left join element_management as c on a.element_b = c.id and c.valid_flag = 1
|
where a.valid_flag = 1 and a.id= #{id}
|
</select>
|
|
</mapper>
|