立档单位-库房-档案柜

new
JiilingLee 1 year ago
parent f5aa78f655
commit 21e3f430db

@ -60,7 +60,7 @@ public interface DepotMapper extends BaseMapperX<DepotDO> {
@Select("SELECT d.id AS depotId, d.name AS depotName, d.code AS depotCode, " +
"c.id AS cabinetId, c.name AS cabinetName, c.code AS cabinetCode " +
"FROM setting_depot d " +
"JOIN setting_depot_cabinet c ON d.id = c.depot_id " +
"LEFT JOIN setting_depot_cabinet c ON d.id = c.depot_id " +
"WHERE d.organization_id = #{organizationId}")
@Results({
@Result(property = "depotId", column = "depotId"),

@ -48,19 +48,16 @@ public interface OrganizationMapper extends BaseMapperX<OrganizationDO> {
.orderByDesc(OrganizationDO::getId));
}
@Select("SELECT o.id AS organizationId, o.organization_name AS organizationName, o.organization_code AS organizationCode, " +
"d.id AS depotId, d.name AS depotName, d.code AS depotCode, " +
"c.id AS cabinetId, c.name AS cabinetName, c.code AS cabinetCode " +
"FROM setting_organization o " +
"LEFT JOIN setting_depot d ON o.id = d.organization_id " +
"LEFT JOIN setting_depot_cabinet c ON d.id = c.depot_id ")
@Results({
@Result(property = "organizationId", column = "organizationId"),
@Select("SELECT o.id AS organizationId, o.organization_name AS organizationName, o.organization_code AS organizationCode, "
+ "d.id AS depotId, d.name AS depotName, d.code AS depotCode, "
+ "IFNULL(c.id, '') AS cabinetId, IFNULL(c.name, '') AS cabinetName, IFNULL(c.code, '') AS cabinetCode "
+ "FROM setting_organization o "
+ "LEFT JOIN setting_depot d ON o.id = d.organization_id "
+ "LEFT JOIN setting_depot_cabinet c ON d.id = c.depot_id ")
@Results({ @Result(property = "organizationId", column = "organizationId"),
@Result(property = "organizationName", column = "organizationName"),
@Result(property = "organizationCode", column = "organizationCode"),
@Result(property = "children", column = "organizationId",javaType = List.class,
many=@Many(select="cn.iocoder.yudao.module.setting.dal.mysql.depot.DepotMapper.getDepotCabinetByOrganization"))
})
@Result(property = "children", column = "organizationId",javaType = List.class, many=@Many(select="cn.iocoder.yudao.module.setting.dal.mysql.depot.DepotMapper.getDepotCabinetByOrganization")) })
List<OrganizationDepotVO> getOrganizationDepotCabinets();
}

Loading…
Cancel
Save