Fix Bug #577: AI修复
This commit is contained in:
@@ -0,0 +1,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.openhis.application.mapper.CatalogItemMapper">
|
||||
|
||||
<resultMap id="CatalogItemResult" type="com.openhis.application.domain.entity.CatalogItem">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="status" column="status"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 修复 Bug #577:关联字典表获取使用单位中文名称,避免前端直接回显字典ID -->
|
||||
<select id="selectCatalogItemsForLabRequest" resultMap="CatalogItemResult">
|
||||
SELECT
|
||||
c.id,
|
||||
c.name,
|
||||
c.price,
|
||||
c.unit_id,
|
||||
d.dict_label AS unit_name,
|
||||
c.category,
|
||||
c.status
|
||||
FROM catalog_item c
|
||||
LEFT JOIN sys_dict_data d ON c.unit_id = d.dict_id AND d.dict_type = 'catalog_unit'
|
||||
WHERE c.status = 1 AND c.category = 'LAB'
|
||||
ORDER BY c.name ASC
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="CatalogItemResult">
|
||||
SELECT id, name, price, unit_id, category, status FROM catalog_item WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="CatalogItemResult">
|
||||
SELECT id, name, price, unit_id, category, status FROM catalog_item
|
||||
<where>
|
||||
<if test="name != null and name != ''">AND name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="category != null and category != ''">AND category = #{category}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user