48 lines
1.6 KiB
XML
48 lines
1.6 KiB
XML
<?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.chaozhanggui.system.cashierservice.dao.SysDictMapper">
|
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.SysDict">
|
|
<id column="dict_id" jdbcType="BIGINT" property="dictId"/>
|
|
<result column="dict_name" jdbcType="VARCHAR" property="dictName"/>
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
<result column="value" jdbcType="VARCHAR" property="value"/>
|
|
<result column="is_child" jdbcType="INTEGER" property="isChild"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
dict_id
|
|
, dict_name , name, value, is_child
|
|
</sql>
|
|
<sql id="Child_Column_List">
|
|
dict_id
|
|
, dict_name , name, value
|
|
</sql>
|
|
|
|
<select id="selectHot" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from sys_dict
|
|
where type = 'hot'
|
|
and status =1
|
|
order by sort
|
|
</select>
|
|
|
|
<select id="selectByType" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from sys_dict
|
|
where type = 'common'
|
|
<if test="type != null and type !=''">
|
|
or type = #{type}
|
|
</if>
|
|
and status =1
|
|
order by sort
|
|
</select>
|
|
|
|
<select id="selectByDictId" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Child_Column_List"/>
|
|
from sys_dict
|
|
where rele_id = #{dictId} and status =1
|
|
order by sort
|
|
</select>
|
|
</mapper> |