From cb8362c6be7f1489796ab88416013b723d6d1735 Mon Sep 17 00:00:00 2001 From: mg <maokecheng@163.com> Date: 星期四, 13 十月 2022 11:37:58 +0800 Subject: [PATCH] 返回字典字段 --- ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml b/ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml index 3fb21d4..d4bc27c 100644 --- a/ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml +++ b/ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml @@ -17,10 +17,27 @@ <result column="informant_phone_code" property="informantPhoneCode" /> <result column="informant_id_card" property="informantIdCard" /> </resultMap> - + <resultMap type="com.ycl.entity.caseHandler.Violations" id="CondMapResultMap" extends="BaseResultMap"> + <result column="category_text" property="categoryText" /> + <result column="type_text" property="typeText" /> + <result column="grade_text" property="gradeText" /> + </resultMap> <!-- 閫氱敤鏌ヨ缁撴灉鍒� --> <sql id="Base_Column_List"> id, category_id, type_id, grade_id, action_cause, link_shop, shop_name, car_number, description, informant, informant_phone_code, informant_id_card </sql> - + <select id="selectCondMap" parameterType="map" resultMap="CondMapResultMap"> + SELECT + uv.*, + udd.name category_text, + udd2.name type_text, + udd3.name grade_text + FROM + ums_violations uv + LEFT JOIN ums_data_dictionary udd on uv.category_id = udd.id and udd.type_code = '01' + LEFT JOIN ums_data_dictionary udd2 on uv.type_id = udd2.id and udd.type_code = '01' + LEFT JOIN ums_data_dictionary udd3 on uv.grade_id = udd3.id and udd.type_code = '01' + WHERE + uv.`id` = #{id} + </select> </mapper> -- Gitblit v1.8.0