app试验管理、审查管理、检测报告管理、合格证管理
This commit is contained in:
parent
d62b7314a0
commit
d2e4193511
|
|
@ -142,4 +142,11 @@ public interface SamplesManageAppDao {
|
|||
* @return
|
||||
*/
|
||||
int getCountByDepartmentId(Integer departmentId, Integer customId);
|
||||
|
||||
/**
|
||||
* 根据id查询数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int getCountById(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,6 +227,11 @@ public class SamplesManageAppServiceImpl implements SamplesManageAppService {
|
|||
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||
data.setUpdateBy(userId);
|
||||
//删除详情
|
||||
//查询是否为最后一条数据
|
||||
int count = samplesManageAppDao.getCountById(data.getId());
|
||||
if (count<=1){
|
||||
return ServerResponse.createBySuccessMsg("不可删除,请至少保留一条数据");
|
||||
}
|
||||
int res = samplesManageAppDao.delSamplesDetailsList(data);
|
||||
if (res > 0) {
|
||||
return ServerResponse.createBySuccessMsg("删除成功");
|
||||
|
|
|
|||
|
|
@ -231,4 +231,9 @@
|
|||
AND p_id = #{customId}
|
||||
AND id = #{departmentId}
|
||||
</select>
|
||||
<select id="getCountById" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM tb_sample_device
|
||||
WHERE sample_id IN (SELECT tsd.sample_id FROM tb_sample_device tsd WHERE tsd.id = #{id})
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue