manage:抽取sql

dev_2.0.0
xueqingkun 2 years ago
parent 5e6f029dc8
commit 4ac974c50e

@ -51,7 +51,7 @@ public class DiseasePhysicalManageController {
@ApiOperation("根据疾病id查询体格检查列表") @ApiOperation("根据疾病id查询体格检查列表")
@GetMapping("/queryListByDiseaseId") @GetMapping("/queryListByDiseaseId")
public List<DiseasePhysicalResVo> queryListByDiseaseId(@RequestParam String diseaseId) { public List<DiseasePhysicalResVo> queryListByDiseaseId(@RequestParam("diseaseId") String diseaseId) {
return diseasePhysicalManageService.queryListByDiseaseId(diseaseId); return diseasePhysicalManageService.queryListByDiseaseId(diseaseId);

@ -36,37 +36,29 @@
<result property="nameZhPath" column="nameZhPath" /> <result property="nameZhPath" column="nameZhPath" />
</resultMap> </resultMap>
<select id="queryList" resultMap="askQuestionLibraryResultMap" parameterType="com.supervision.vo.manage.AskQuestionLibraryReqVo"> <sql id="queryListsql">
select atql.id as id, select
atql.default_answer, atql.id as id,
atql.id as libraryQuestionId, atql.default_answer,
cd.code as code, atql.id as libraryQuestionId,
atql.dict_id as dictId, cd.code as code,
atql.question as question, atql.dict_id as dictId,
cd.name_zh_path as nameZhPath atql.question as question,
cd.name_zh_path as nameZhPath
from vp_ask_template_question_library atql from vp_ask_template_question_library atql
left join vp_common_dic cd on atql.dict_id = cd.id left join vp_common_dic cd on atql.dict_id = cd.id
<where> <where>
<if test="askQuestionLibrary.code != null and askQuestionLibrary.code != '' "> <if test="askQuestionLibrary.code != null and askQuestionLibrary.code != '' ">
AND cd.code = #{askQuestionLibrary.code} AND cd.code = #{askQuestionLibrary.code}
</if> </if>
</where> </where>
</sql>
<select id="queryList" resultMap="askQuestionLibraryResultMap" parameterType="com.supervision.vo.manage.AskQuestionLibraryReqVo">
<include refid="queryListsql"></include>
</select> </select>
<select id="queryPageList" resultMap="askQuestionLibraryResultMap" resultType="com.supervision.vo.manage.AskQuestionLibraryResVo"> <select id="queryPageList" resultMap="askQuestionLibraryResultMap" resultType="com.supervision.vo.manage.AskQuestionLibraryResVo">
select atql.id as id, <include refid="queryListsql"></include>
atql.default_answer,
cd.code as code,
atql.id as libraryQuestionId,
atql.dict_id as dictId,
atql.question as question,
cd.name_zh_path as nameZhPath
from vp_ask_template_question_library atql
left join vp_common_dic cd on atql.dict_id = cd.id
<where>
<if test="askQuestionLibrary.code != null and askQuestionLibrary.code != '' ">
AND cd.code = #{askQuestionLibrary.code}
</if>
</where>
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save