<?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.yiboshi.science.dao.SystemParameterDAO"> <sql id="allColumns"> t.id as id, t.type_id as typeId, t.parent_id as parentId, t.name as name, t.gb_code as gbCode, t.tree_code as treeCode, t.display_order as displayOrder, t.note_state as noteState, t.system_code as systemCode </sql> <select id="getList" resultType="com.yiboshi.science.entity.SystemParameter"> SELECT c.* FROM system_parameter c <where> ${ew.sqlSegment} </where> order by type_id,display_order asc </select> <select id="getListByPage" resultType="com.yiboshi.science.param.dto.SystemParameterDTO"> select a.*,b.name parentName,c.name typeName from system_parameter a left join system_parameter b on a.parent_id=b.id left join system_parameter_type c on a.type_id=c.type_id <where> ${ew.sqlSegment} </where> order by a.type_id,b.display_order,a.display_order asc </select> <select id="getParentParameterList" resultType="com.yiboshi.science.entity.SystemParameter"> select a.* from system_parameter a where type_id in (select a.parent_id from system_parameter_type a where a.parent_id is not null) order by a.type_id,a.display_order asc </select> </mapper>