| | |
| | | /** |
| | | * 应急预案删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencySupplies(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencySupplies(@RequestBody Long[] ids){ |
| | | return emergencySuppliesService.batchDeleteEmergencySupplies(ids); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 应急物资检查删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencySuppliesInspect(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencySuppliesInspect(@RequestBody Long[] ids){ |
| | | return emergencySuppliesInspectService.batchDeleteEmergencySuppliesInspect(ids); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 应急物资检查删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencySuppliesMaintain(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencySuppliesMaintain(@RequestBody Long[] ids){ |
| | | return emergencySuppliesMaintainService.batchDeleteEmergencySuppliesMaintain(ids); |
| | | } |
| | | } |
| | |
| | | private Integer usePeriod; |
| | | private Long departmentId; |
| | | private Long principalUserUid; |
| | | private String principalUserName; |
| | | private String status; |
| | | private String classification; |
| | | private String name; |
| | |
| | | this.useExplain = useExplain; |
| | | } |
| | | |
| | | |
| | | public String getPrincipalUserName() { |
| | | return principalUserName; |
| | | } |
| | | |
| | | public void setPrincipalUserName(String principalUserName) { |
| | | this.principalUserName = principalUserName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EmergencySuppliesInfo{" + |
| | |
| | | @TableName("emergency_supplies") |
| | | public class EmergencySuppliesInfoDetailDO { |
| | | |
| | | private String principalUserName; |
| | | |
| | | public String getPrincipalUserName() { |
| | | return principalUserName; |
| | | } |
| | | |
| | | public void setPrincipalUserName(String principalUserName) { |
| | | this.principalUserName = principalUserName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Date productionDate; |
| | |
| | | @TableName("emergency_supplies_inspect") |
| | | public class EmergencySuppliesInspectInfoDetailDO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_supplies_inspect") |
| | | public class EmergencySuppliesInspectInfoPageDO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_supplies_inspect") |
| | | public class EmergencySuppliesInspectUserInfo { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Boolean delFlag; |
| | |
| | | @TableName("emergency_supplies_inspect") |
| | | public class EmergencySuppliesInspectUserInfoDO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_supplies_maintain") |
| | | public class EmergencySuppliesMaintainInfoDetailDO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_supplies_maintain") |
| | | public class EmergencySuppliesMaintainInfoPageDO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_supplies_maintain") |
| | | public class EmergencySuppliesMaintainUserInfo { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Boolean delFlag; |
| | |
| | | @TableName("emergency_supplies_maintain") |
| | | public class EmergencySuppliesMaintainUserInfoDO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | |
| | | public class EmergencySuppliesInspectUserReqDTO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long inspectId; |
| | |
| | | |
| | | public class EmergencySuppliesMaintainUserReqDTO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long maintainId; |
| | |
| | | |
| | | public class EmergencySuppliesReqDTO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private String principalUserName; |
| | | |
| | | public String getPrincipalUserName() { |
| | | return principalUserName; |
| | | } |
| | | |
| | | public void setPrincipalUserName(String principalUserName) { |
| | | this.principalUserName = principalUserName; |
| | | } |
| | | |
| | | private Long id; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date productionDate; |
| | |
| | | |
| | | public class EmergencySuppliesDetailRespDTO { |
| | | |
| | | private String principalUserName; |
| | | |
| | | public String getPrincipalUserName() { |
| | | return principalUserName; |
| | | } |
| | | |
| | | public void setPrincipalUserName(String principalUserName) { |
| | | this.principalUserName = principalUserName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | |
| | | public class EmergencySuppliesInspectDetailRespDTO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long suppliesId; |
| | |
| | | |
| | | public class EmergencySuppliesInspectPageRespDTO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long suppliesId; |
| | |
| | | |
| | | public class EmergencySuppliesInspectUserRespDTO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long inspectId; |
| | |
| | | |
| | | public class EmergencySuppliesMaintainDetailRespDTO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long suppliesId; |
| | |
| | | |
| | | public class EmergencySuppliesMaintainPageRespDTO { |
| | | |
| | | private String suppliesName; |
| | | |
| | | public String getSuppliesName() { |
| | | return suppliesName; |
| | | } |
| | | |
| | | public void setSuppliesName(String suppliesName) { |
| | | this.suppliesName = suppliesName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long suppliesId; |
| | |
| | | |
| | | public class EmergencySuppliesMaintainUserRespDTO { |
| | | |
| | | private String userName; |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long maintainId; |
| | |
| | | |
| | | public class EmergencySuppliesPageRespDTO { |
| | | |
| | | private String deptName; |
| | | |
| | | public String getDeptName() { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private String name; |
| | |
| | | |
| | | ResultVO updateEmergencySuppliesInspect(Long uid, EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencySuppliesInspect(String ids); |
| | | ResultVO batchDeleteEmergencySuppliesInspect(Long[] ids); |
| | | } |
| | |
| | | |
| | | ResultVO updateEmergencySuppliesMaintain(Long uid, EmergencySuppliesMaintainReqDTO emergencySuppliesMaintainReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencySuppliesMaintain(String ids); |
| | | ResultVO batchDeleteEmergencySuppliesMaintain(Long[] ids); |
| | | } |
| | |
| | | |
| | | ResultVO updateEmergencySupplies(Long uid, EmergencySuppliesReqDTO emergencySuppliesReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencySupplies(String ids); |
| | | ResultVO batchDeleteEmergencySupplies( Long[] ids); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencySuppliesInspect(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | public ResultVO batchDeleteEmergencySuppliesInspect(Long[] ids) { |
| | | |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_INSPECT_NULL); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencySuppliesInspect(Long.valueOf(id)); |
| | | for (Long id : ids){ |
| | | deleteEmergencySuppliesInspect(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencySuppliesMaintain(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | public ResultVO batchDeleteEmergencySuppliesMaintain(Long[] ids) { |
| | | |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_MAINTAIN_NULL); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencySuppliesMaintain(Long.valueOf(id)); |
| | | for (Long id : ids){ |
| | | deleteEmergencySuppliesMaintain(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.*; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("emergencySuppliesService") |
| | | public class EmergencySuppliesServiceImpl implements EmergencySuppliesService { |
| | | |
| | | @Autowired |
| | | private EmergencySuppliesInfoService emergencySuppliesInfoService; |
| | | |
| | | @DubboReference(check = false) |
| | | private AccountDepartmentService accountDepartmentService; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | List<EmergencySuppliesInfoPageDO> emergencySuppliesListDoInfoList = emergencySuppliesInfoService.selectEmergencySuppliesList(page,emergencySuppliesDBQuery); |
| | | List<EmergencySuppliesPageRespDTO> respList = BeanCopyUtils.copyBeanList(emergencySuppliesListDoInfoList, EmergencySuppliesPageRespDTO.class); |
| | | |
| | | Map<Long, String> depPool = new HashMap<>(); |
| | | |
| | | respList.forEach(AccidentExpressPageRespDTO ->{ |
| | | // 设置部门名称 |
| | | if (!depPool.containsKey(AccidentExpressPageRespDTO.getDepartmentId())) { |
| | | ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(AccidentExpressPageRespDTO.getDepartmentId()); |
| | | if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) { |
| | | if (rpcResult.getData() != null) { |
| | | DepInfoRPCRespDTO dep = (DepInfoRPCRespDTO) rpcResult.getData(); |
| | | |
| | | depPool.put(dep.getDepId(), dep.getDepName()); |
| | | } |
| | | }} |
| | | |
| | | String depName = depPool.get(AccidentExpressPageRespDTO.getDepartmentId()); |
| | | AccidentExpressPageRespDTO.setDeptName(depName); |
| | | }); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencySupplies(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | public ResultVO batchDeleteEmergencySupplies( Long[] ids) { |
| | | |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_NULL); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencySupplies(Long.valueOf(id)); |
| | | for (Long id : ids){ |
| | | deleteEmergencySupplies(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | |
| | | <if test="usePeriod != null ">use_period,</if> |
| | | <if test="departmentId != null ">department_id,</if> |
| | | <if test="principalUserUid != null ">`principal_user_uid`,</if> |
| | | <if test="principalUserName != null and principalUserName != ''">`principal_user_name`,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="classification != null and classification != ''">`classification`,</if> |
| | | <if test="name != null and name != ''">`name`,</if> |
| | |
| | | <if test="usePeriod != null ">#{usePeriod},</if> |
| | | <if test="departmentId != null ">#{departmentId},</if> |
| | | <if test="principalUserUid != null ">#{principalUserUid},</if> |
| | | <if test="principalUserName != null and principalUserName != ''">#{principalUserName},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="classification != null and classification != ''">#{classification},</if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | |
| | | <result column="use_period" property="usePeriod"/> |
| | | <result column="department_id" property="departmentId"/> |
| | | <result column="principal_user_uid" property="principalUserUid"/> |
| | | <result column="principal_user_name" property="principalUserName"/> |
| | | <result column="status" property="status"/> |
| | | <result column="classification" property="classification"/> |
| | | <result column="name" property="name"/> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesById" resultMap="emergencySuppliesInfoDetailDOResult"> |
| | | select id ,`production_date`,`use_date`,`inspect_date`,`next_inspect_date`,inspect_period ,`count` ,use_period ,department_id ,principal_user_uid , |
| | | select id ,`production_date`,`use_date`,`inspect_date`,`next_inspect_date`,inspect_period ,`count` ,use_period ,department_id ,principal_user_uid ,principal_user_name, |
| | | status ,classification ,`name` ,`number` ,model ,longitude ,latitude ,`use` ,area_id ,place ,use_explain |
| | | from emergency_supplies where del_flag = 0 and id = #{id} |
| | | </select> |
| | |
| | | <if test="usePeriod != null ">use_period = #{usePeriod},</if> |
| | | <if test="departmentId != null ">department_id = #{departmentId},</if> |
| | | <if test="principalUserUid != null ">`principal_user_uid` = #{principalUserUid},</if> |
| | | <if test="principalUserName != null and principalUserName != ''">principal_user_name = #{principalUserName},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="classification != null and classification != ''">`classification` = #{classification},</if> |
| | | <if test="name != null and name != ''">`name` = #{name},</if> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesInspectList" resultMap="emergencySuppliesInspectInfoPageDOResult"> |
| | | select id,`supplies_id`,`inspect_result`,`inspect_time` from emergency_supplies_inspect where del_flag = 0 |
| | | <if test="query.suppliesId != null and query.suppliesId != ''">and `supplies_id` = #{query.suppliesId}</if> |
| | | SELECT |
| | | a.id, |
| | | a.`supplies_id`, |
| | | a.`inspect_result`, |
| | | a.`inspect_time`, |
| | | b.`name` AS suppliesName |
| | | FROM |
| | | emergency_supplies_inspect a |
| | | LEFT JOIN emergency_supplies b ON a.supplies_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 |
| | | <if test="query.suppliesId != null and query.suppliesId != ''">and a.supplies_id = #{query.suppliesId}</if> |
| | | </select> |
| | | |
| | | <insert id="addEmergencySuppliesInspect" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInspectInfo" |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesInspectById" resultMap="emergencySuppliesInspectInfoDetailDOResult"> |
| | | select id,`supplies_id`,`inspect_result`,`inspect_time` from emergency_supplies_inspect where del_flag = 0 and id = #{id} |
| | | SELECT |
| | | a.id, |
| | | a.`supplies_id`, |
| | | a.`inspect_result`, |
| | | a.`inspect_time`, |
| | | b.`name` AS suppliesName |
| | | FROM |
| | | emergency_supplies_inspect a |
| | | LEFT JOIN emergency_supplies b ON a.supplies_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 and a.id = #{id} |
| | | </select> |
| | | |
| | | <update id="updateEmergencySuppliesInspect" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInspectInfo"> |
| | |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | <if test="inspectId != null ">inspect_id,</if> |
| | | <if test="userUid != null ">user_uid,</if> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | <if test="inspectId != null ">#{inspectId},</if> |
| | | <if test="userUid != null ">#{userUid},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="inspect_id" property="inspectId" /> |
| | | <result column="user_uid" property="userUid" /> |
| | | <result column="user_name" property="userName" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesInspectUserBySuppliesInspectId" resultMap="emergencySuppliesInspectUserInfoDOResult"> |
| | | select id,`inspect_id`,`user_uid` from emergency_supplies_inspect_user where del_flag = 0 and inspect_id = #{suppliesInspectId} |
| | | select id,`inspect_id`,`user_uid`,user_name from emergency_supplies_inspect_user where del_flag = 0 and inspect_id = #{suppliesInspectId} |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencySuppliesInspectUserByIds" > |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesMaintainList" resultMap="emergencySuppliesMaintainInfoPageDOResult"> |
| | | select id,`supplies_id`,`maintain_result`,`maintain_time` from emergency_supplies_maintain where del_flag = 0 |
| | | <if test="query.suppliesId != null and query.suppliesId != ''">and `supplies_id` = #{query.suppliesId}</if> |
| | | SELECT |
| | | a.id, |
| | | a.`supplies_id`, |
| | | a.`maintain_result`, |
| | | a.`maintain_time`, |
| | | b.`name` AS suppliesName |
| | | FROM |
| | | emergency_supplies_maintain a |
| | | LEFT JOIN emergency_supplies b ON a.supplies_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 |
| | | <if test="query.suppliesId != null and query.suppliesId != ''">and a.supplies_id = #{query.suppliesId}</if> |
| | | </select> |
| | | |
| | | <insert id="addEmergencySuppliesMaintain" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesMaintainInfo" |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesMaintainById" resultMap="emergencySuppliesMaintainInfoDetailDOResult"> |
| | | select id,`supplies_id`,`maintain_result`,`maintain_time` from emergency_supplies_maintain where del_flag = 0 and id = #{id} |
| | | |
| | | SELECT |
| | | a.id, |
| | | a.`supplies_id`, |
| | | a.`maintain_result`, |
| | | a.`maintain_time`, |
| | | b.`name` AS suppliesName |
| | | FROM |
| | | emergency_supplies_maintain a |
| | | LEFT JOIN emergency_supplies b ON a.supplies_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 and a.id = #{id} |
| | | </select> |
| | | |
| | | <update id="updateEmergencySuppliesMaintain" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesMaintainInfo"> |
| | |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | <if test="maintainId != null ">maintain_id,</if> |
| | | <if test="userUid != null ">user_uid,</if> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | <if test="maintainId != null ">#{maintainId},</if> |
| | | <if test="userUid != null ">#{userUid},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="maintain_id" property="maintainId" /> |
| | | <result column="user_uid" property="userUid" /> |
| | | <result column="user_name" property="userName" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencySuppliesMaintainUserBySuppliesMaintainId" resultMap="emergencySuppliesMaintainUserInfoDOResult"> |
| | | select id,`maintain_id`,`user_uid` from emergency_supplies_maintain_user where del_flag = 0 and maintain_id = #{suppliesMaintainId} |
| | | select id,`maintain_id`,`user_uid`,user_name from emergency_supplies_maintain_user where del_flag = 0 and maintain_id = #{suppliesMaintainId} |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencySuppliesMaintainUserByIds" > |