1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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>
<select id="getSpecArray" resultType="com.yiboshi.science.param.dto.SpecDTO">
select a.id as `key`, b.id as pkey, c.id as ppkey
from system_parameter a
left join system_parameter b on a.parent_id = b.id
left join system_parameter c on b.parent_id = c.id
where a.type_id = 68 and b.id is not null and c.id is not null
</select>
</mapper>