<?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.ruoyi.system.mapper.TItemTypeMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.model.TItemType">
|
<id column="id" property="id" />
|
<result column="type_name" property="typeName" />
|
<result column="sort_by" property="sortBy" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
<result column="create_by" property="createBy" />
|
<result column="update_by" property="updateBy" />
|
<result column="disabled" property="disabled" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, type_name, sort_by, create_time, update_time, create_by, update_by, disabled
|
</sql>
|
<select id="pageList" resultType="com.ruoyi.system.model.TItemType">
|
select
|
<include refid="Base_Column_List"/>
|
from t_item_type
|
where disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
ORDER BY sort_by,create_time DESC
|
</select>
|
<select id="getItemList" resultType="com.ruoyi.system.vo.TItemTypeVO">
|
select <include refid="Base_Column_List"></include>
|
from t_item_type
|
where id in (
|
select
|
tit.id
|
from t_item_type tit
|
left join t_item ti on tit.id = ti.type_id
|
where tit.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
<if test="itemName != null and itemName != ''">
|
and ti.item_name like concat('%', #{itemName}, '%')
|
</if>
|
GROUP BY tit.id
|
ORDER BY tit.sort_by,tit.create_time DESC)
|
</select>
|
|
</mapper>
|