| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?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="platform.common.base.dao.DictionaryItemDao">
- <select id="getDictionaryItem" resultType="platform.common.base.model.DictionaryItem">
- select * from dictionary_item
- where del_flag=0
- <if test="name!=null and name!=''">
- and name=#{name}
- </if>
- <if test="value!=null and value!=''">
- and value=#{value}
- </if>
- <if test="typeId!=null">
- and tid=#{typeId}
- </if>
- limit 0,1
- </select>
-
- <select id="findByTypeAndValue" resultType="platform.common.base.model.DictionaryItem">
- select *
- from dictionary_item item
- left join dictionary_type dtype on item.tid = dtype.id
- where item.value=#{value} and dtype.name = #{typeName} and item.del_flag=0
- limit 0,1
- </select>
-
- <select id="findByTypeAndCondition" resultType="platform.common.base.model.DictionaryItem">
- select *
- from dictionary_item item
- left join dictionary_type dtype on item.tid = dtype.id
- where
- dtype.name = #{typeName}
- and item.del_flag=0
- <if test="itemCondition.name!=null and itemCondition.name!=''">
- and item.name=#{itemCondition.name}
- </if>
- <if test="itemCondition.is_active != null and itemCondition.is_active != '' ">
- and item.is_active=#{itemCondition.is_active}
- </if>
- <if test="itemCondition.value!=null and itemCondition.value!=''">
- and item.value=#{itemCondition.value}
- </if>
- order by item.create_time desc
- limit 0,1
- </select>
- </mapper>
|