Compare commits

...

2 Commits

Author SHA1 Message Date
haoyuanfu“;git config --global user.name haoyuanfu“ 333f88d741 Merge remote-tracking branch 'origin/main' 2 weeks ago
haoyuanfu“;git config --global user.name haoyuanfu“ 37dec7e3cd 大华接口鉴权以及引用包 2 weeks ago
  1. 52
      src/main/resources/mappers/SysDictionaryMapper.xml

@ -0,0 +1,52 @@
<?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.zilber.boot.system.dao.SysDictionaryMapper">
<resultMap type="com.zilber.boot.system.pojo.SysDictionary" id="SysDictionaryResult">
<id property="id" column="id"/>
<result property="code" column="code" />
<result property="name" column="name" />
<result property="value" column="value" />
<result property="remark" column="remark" />
<result property="level" column="level" />
<result property="path" column="path" />
<result property="parentId" column="parent_id" />
<result property="contactCode" column="contact_code" />
<result property="isDel" column="is_del" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<collection property="subSysDictionaryList" ofType="com.zilber.boot.system.pojo.SysDictionary"
select="com.zilber.boot.system.dao.SysDictionaryMapper.queryByParentId" column="id">
</collection>
</resultMap>
<sql id="selectDictionaryVo">
select id,code,name,`value`,remark,level,path,parent_id,contact_code,is_del,sort,create_by,create_time,update_by,update_time
from sys_dictionary
</sql>
<select id="getList" parameterType="com.zilber.boot.system.pojo.SysDictionary" resultMap="SysDictionaryResult">
<include refid="selectDictionaryVo"/>
<where>
is_del=1 and parent_id=#{parentId}
<if test="name != null and name != ''">
and `name` = #{name}
</if>
<if test="code != null and code != ''">
and `code` = #{code}
</if>
</where>
order by sort
</select>
<select id="queryByParentId" parameterType="com.zilber.boot.system.pojo.SysDictionary" resultMap="SysDictionaryResult">
<include refid="selectDictionaryVo"/>
where parent_id=#{id} and is_del=1
order by sort asc
</select>
</mapper>
Loading…
Cancel
Save