提交 9802b49d 作者: 刘明祎-运维用途

根据后台id查询培训机构信息

上级 ab725e3a
流水线 #7117 已通过 于阶段
in 2 分 58 秒
......@@ -36,6 +36,13 @@ public class LicenceBackgroundController extends BaseController {
return licenceBackgroundService.insertOrganizations(organizations, this.getUserLoginInfoFromRedis(request));
}
@ApiOperation(value = "机构-根据后台id查询")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/selectOrg")
public ResultBody<LicenseOrganizationsDTO> selectOrganizations(@ApiParam(value = "机构id", required = true) @RequestParam Integer backUserId) {
return licenceBackgroundService.selectOrganizations(backUserId);
}
@ApiOperation(value = "机构-修改")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/updateOrg")
......
......@@ -36,6 +36,9 @@ public interface LicenceBackgroundDao {
List<LicenseOrganizationsDO> listOrgPage(LicenseOrganizationsQO organizationsQO);
LicenseOrganizationsDO selectOrganizations(Integer backUserId);
List<LicenseProgramsDO> selectPrograms(Integer orgId);
List<LicenseProgramsDO> trainingProgram(LicenseOrganizationsQO organizationsQO);
......
......@@ -18,6 +18,6 @@ public interface LicenceBackgroundService {
ResultBody removeOrganizations(Integer id);
ResultBody selectOrganizations(Integer backUserId);
PageResult listOrgPage(LicenseOrganizationsQO organizationsQO, LoginSuccessDTO userLoginInfoFromRedis);
}
......@@ -134,6 +134,17 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
}
@Override
public ResultBody selectOrganizations(Integer backUserId) {
LicenseOrganizationsDO licenseOrganizationsDO = licenceBackgroundDao.selectOrganizations(backUserId);
LicenseOrganizationsDTO licenseOrganizationsDTO = licenseOrganizationsDO.organizationsDTO();
Integer orgId = licenseOrganizationsDTO.getId();
List<LicenseProgramsDO> licenseProgramsDOS = licenceBackgroundDao.selectPrograms(orgId);
List<LicenseTrainingProgramsDTO> orgList = licenseProgramsDOS.stream().map(LicenseProgramsDO :: buildTrainingProgramsDTO).collect(Collectors.toList());
licenseOrganizationsDTO.setProgramsDOList(orgList);
return ResultBody.success(licenseOrganizationsDTO);
}
@Override
public PageResult listOrgPage(LicenseOrganizationsQO organizationsQO, LoginSuccessDTO userLoginInfoFromRedis) {
int count = licenceBackgroundDao.countListOrgPage(organizationsQO);
if (count == 0) {
......
......@@ -237,6 +237,52 @@
and ltp.type_id =#{typeId}
</if>
</select>
<select id="selectOrganizations" resultType="com.mmc.csf.release.entity.licence.LicenseOrganizationsDO">
SELECT lo.id,
lo.main_image AS mainImage,
lo.auxiliary_picture AS auxiliaryPicture,
lo.video,
lo.`name`,
lo.region,
lo.test_center AS testCenter,
lo.scale_id AS scaleId,
ls.`name` AS scaleName,
lo.description,
lo.detail,
lo.create_time AS createTime,
lo.update_time AS updateTime,
lo.detailed_address AS detailedAddress,
lo.region_name AS regionName,
lo.longitude,
lo.latitude,
lo.create_time AS createTime,
lo.update_time AS updateTime
FROM license_organizations lo
LEFT JOIN licence_scale ls ON lo.scale_id = ls.id
where 1=1
and lo.back_user_id = #{backUserId}
</select>
<select id="selectPrograms" resultType="com.mmc.csf.release.entity.licence.LicenseProgramsDO">
SELECT DISTINCT
ltp.id,
ltp.grade_id AS gradeId,
lg.`name` AS gradeName,
ltp.models_id AS modelsId,
lm.`name` AS modelsName,
ltp.type_id AS typeId,
lt.`name` AS typeName,
ltp.price,
ltp.place,
ltp.main_image AS mainImage,
ltp.org_id AS orgId
FROM
license_training_programs ltp
LEFT JOIN licence_grade lg ON ltp.grade_id = lg.id
LEFT JOIN licence_models lm ON ltp.models_id = lm.id
LEFT JOIN licence_type lt ON ltp.type_id = lt.id
WHERE
1 =1 and ltp.org_id = #{orgId}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论