manage:抽取sql

dev_2.0.0
xueqingkun 1 year ago
parent 5e6f029dc8
commit 4ac974c50e

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

@ -36,37 +36,29 @@
<result property="nameZhPath" column="nameZhPath" />
</resultMap>
<select id="queryList" resultMap="askQuestionLibraryResultMap" parameterType="com.supervision.vo.manage.AskQuestionLibraryReqVo">
select atql.id as id,
atql.default_answer,
atql.id as libraryQuestionId,
cd.code as code,
atql.dict_id as dictId,
atql.question as question,
cd.name_zh_path as nameZhPath
<sql id="queryListsql">
select
atql.id as id,
atql.default_answer,
atql.id as libraryQuestionId,
cd.code as code,
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
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>
</sql>
<select id="queryList" resultMap="askQuestionLibraryResultMap" parameterType="com.supervision.vo.manage.AskQuestionLibraryReqVo">
<include refid="queryListsql"></include>
</select>
<select id="queryPageList" resultMap="askQuestionLibraryResultMap" resultType="com.supervision.vo.manage.AskQuestionLibraryResVo">
select atql.id as id,
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>
<include refid="queryListsql"></include>
</select>
</mapper>

Loading…
Cancel
Save