feat(clinic): 添加医生职位字段并优化文章内容查询- 在 ClinicAppointment 实体中新增 doctorPosition 字段- 更新 ClinicAppointmentMapper.xml 查询语句以包含医生职位信息

- 修复 CmsArticleContentServiceImpl 中参数设置错误的问题
- 在 CmsArticleController 中增强文章内容获取逻辑
- 在 HjmViolation 实体中新增 image 字段用于存储车辆头像- 更新 HjmViolationMapper.xml 查询语句以
This commit is contained in:
2025-10-29 14:40:57 +08:00
parent a3dea10177
commit be2bda8e53
6 changed files with 23 additions and 4 deletions

View File

@@ -43,6 +43,10 @@ public class ClinicAppointment implements Serializable {
@TableField(exist = false)
private String doctorName;
@Schema(description = "医生职位")
@TableField(exist = false)
private String doctorPosition;
@Schema(description = "患者")
private Integer userId;

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.nickname, b.phone, c.real_name as doctorName
SELECT a.*, b.nickname, b.phone, c.real_name as doctorName, c.position as doctorPosition
FROM clinic_appointment a
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
LEFT JOIN clinic_doctor_user c ON a.doctor_id = c.user_id

View File

@@ -83,7 +83,10 @@ public class CmsArticleController extends BaseController {
public ApiResult<CmsArticle> get(@PathVariable("id") @NotNull Integer id) {
final CmsArticle article = cmsArticleService.getByIdRel(id);
if (ObjectUtil.isNotEmpty(article)) {
return success(article);
final CmsArticleContent item = articleContentService.getByIdRel(article.getArticleId());
if (ObjectUtil.isNotEmpty(item)) {
article.setContent(item.getContent());
}
}
return fail("文章ID不存在",null);
}
@@ -92,6 +95,12 @@ public class CmsArticleController extends BaseController {
@GetMapping("/getByCode/{code}")
public ApiResult<CmsArticle> getByCode(@PathVariable("code") String code) {
final CmsArticle article = cmsArticleService.getByIdCode(code);
if (ObjectUtil.isNotEmpty(article)) {
final CmsArticleContent item = articleContentService.getByIdRel(article.getArticleId());
if (ObjectUtil.isNotEmpty(item)) {
article.setContent(item.getContent());
}
}
return success(article);
}

View File

@@ -61,7 +61,7 @@ public class CmsArticleContentServiceImpl extends ServiceImpl<CmsArticleContentM
@Override
public CmsArticleContent getByIdRel(Integer id) {
CmsArticleContentParam param = new CmsArticleContentParam();
param.setId(id);
param.setArticleId(id);
return param.getOne(baseMapper.selectListRel(param));
}

View File

@@ -2,6 +2,7 @@ package com.gxwebsoft.hjm.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
@@ -34,6 +35,10 @@ public class HjmViolation implements Serializable {
@Schema(description = "车辆编号")
private String code;
@Schema(description = "车辆头像")
@TableField(exist = false)
private String image;
@Schema(description = "文章分类ID")
private Integer categoryId;

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*,b.image
FROM hjm_violation a
LEFT JOIN hjm_car b ON a.code = b.code
LEFT JOIN gxwebsoft_core.sys_organization c ON b.organization_id = c.organization_id
@@ -57,6 +57,7 @@
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
OR a.code = #{param.keywords}
)
</if>
</where>