<?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.ElementManagementMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.ElementManagement" >
|
<!-- -->
|
<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="name" property="name" jdbcType="BIGINT" />
|
<result column="type" property="type" jdbcType="VARCHAR" />
|
<result column="parent_id" property="parentId" jdbcType="VARCHAR" />
|
<result column="parent_name" property="parentName" jdbcType="VARCHAR" />
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
<result column="point" property="point" jdbcType="VARCHAR" />
|
<result column="weight" property="weight" />
|
|
</resultMap>
|
<select id="selectPages" resultMap="BaseResultMap">
|
select a.*,
|
b.name parent_name
|
from element_management as a
|
left join element_management as b on a.parent_id = b.id and b.valid_flag = 1
|
where a.valid_flag = 1
|
<if test="params.name != null and params.name != ''">
|
and a.name like concat("%",#{params.name},"%")
|
</if>
|
<if test="params.type != null ">
|
and a.type = #{params.type}
|
</if>
|
order by a.create_time desc
|
</select>
|
|
<select id="getElementByType" resultMap="BaseResultMap">
|
select * from element_management where valid_flag = 1 and type = #{type}
|
</select>
|
|
</mapper>
|