znpt-backend/core/src/main/resources/mapper/DictMapper.xml

38 lines
1.4 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.dite.znpt.mapper.DictMapper">
<sql id="Base_Column_List">
a.dict_id, a.dict_type, a.dict_name, a.parent_id,
a.sort_order, a.final_state, a.create_time, a.create_by,
a.update_time, a.update_by
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.DictResp">
select
<include refid="Base_Column_List"/>
from dict a
<where>
<if test="dictId != null and dictId != ''">
and a.dict_id like concat ('%', #{dictId}, '%')
</if>
<if test="dictType != null and dictType != ''">
and a.dict_type like concat ('%', #{dictType}, '%')
</if>
<if test="dictName != null and dictName != ''">
and a.dict_name like concat ('%', #{dictName}, '%')
</if>
<if test="parentId != null">
and a.parent_id = #{parentId}
</if>
<if test="sortOrder != null">
and a.sort_order = #{sortOrder}
</if>
<if test="finalState != null">
and a.final_state = #{finalState}
</if>
</where>
</select>
</mapper>