Commit 8b84c666 by zhangkb

指标版本管理添加是否已删除状态位判断

parent c246525f
...@@ -21,5 +21,6 @@ public class BaseIndDefVersionData{ ...@@ -21,5 +21,6 @@ public class BaseIndDefVersionData{
private String indName; private String indName;
private String version; private String version;
private String dataJson; private String dataJson;
private String isDelete;//是否已删除 0:否 1:是
private String lastUpdateTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"); private String lastUpdateTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
} }
...@@ -21,5 +21,6 @@ public class DriveIndDefVersionData { ...@@ -21,5 +21,6 @@ public class DriveIndDefVersionData {
private String indName; private String indName;
private String version; private String version;
private String dataJson; private String dataJson;
private String isDelete;//是否已删除 0:否 1:是
private String lastUpdateTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"); private String lastUpdateTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
} }
...@@ -3,6 +3,7 @@ package com.keymobile.indicators.model.mapper.indmapper; ...@@ -3,6 +3,7 @@ package com.keymobile.indicators.model.mapper.indmapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData; import com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData;
...@@ -10,5 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -10,5 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface BaseIndDefVersionDataMapper extends BaseMapper<BaseIndDefVersionData>{ public interface BaseIndDefVersionDataMapper extends BaseMapper<BaseIndDefVersionData>{
public List<BaseIndDefVersionData> getVersionDataByIndId(String indId); public List<BaseIndDefVersionData> getVersionDataByIndId(@Param("indId") String indId);
public void updateIsDeleteStatus(@Param("indId") String indId,@Param("status") String status);
} }
...@@ -3,6 +3,7 @@ package com.keymobile.indicators.model.mapper.indmapper; ...@@ -3,6 +3,7 @@ package com.keymobile.indicators.model.mapper.indmapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData; import com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData;
...@@ -10,5 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -10,5 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface DriveIndDefVersionDataMapper extends BaseMapper<DriveIndDefVersionData>{ public interface DriveIndDefVersionDataMapper extends BaseMapper<DriveIndDefVersionData>{
public List<DriveIndDefVersionData> getVersionDataByIndId(String indId); public List<DriveIndDefVersionData> getVersionDataByIndId(@Param("indId")String indId);
public void updateIsDeleteStatus(@Param("indId") String indId,@Param("status") String status);
} }
...@@ -75,6 +75,7 @@ public class BaseIndDefService { ...@@ -75,6 +75,7 @@ public class BaseIndDefService {
public void delete(String indId) throws Exception{ public void delete(String indId) throws Exception{
baseIndDefMapper.deleteByPrimaryKey(indId); baseIndDefMapper.deleteByPrimaryKey(indId);
baseIndDefVersionService.updateIsDeleteStatus(indId, "1");//标识已删除
} }
public Map<String,Object> getByPageAndKeyword(Integer catalogId,String keyword, public Map<String,Object> getByPageAndKeyword(Integer catalogId,String keyword,
......
...@@ -25,6 +25,7 @@ public class BaseIndDefVersionService { ...@@ -25,6 +25,7 @@ public class BaseIndDefVersionService {
baseIndDefVersionData.setIndId(baseIndDef.getIndId()); baseIndDefVersionData.setIndId(baseIndDef.getIndId());
baseIndDefVersionData.setIndName(baseIndDef.getIndName()); baseIndDefVersionData.setIndName(baseIndDef.getIndName());
baseIndDefVersionData.setVersion(baseIndDef.getVersion()); baseIndDefVersionData.setVersion(baseIndDef.getVersion());
baseIndDefVersionData.setIsDelete("0");//未删除
GsonBuilder gsonBuilder = new GsonBuilder(); GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.setPrettyPrinting(); gsonBuilder.setPrettyPrinting();
Gson gson = gsonBuilder.create(); Gson gson = gsonBuilder.create();
...@@ -36,4 +37,8 @@ public class BaseIndDefVersionService { ...@@ -36,4 +37,8 @@ public class BaseIndDefVersionService {
public List<BaseIndDefVersionData> getVersionDataByIndId(String indId){ public List<BaseIndDefVersionData> getVersionDataByIndId(String indId){
return baseIndDefVersionDataMapper.getVersionDataByIndId(indId); return baseIndDefVersionDataMapper.getVersionDataByIndId(indId);
} }
public void updateIsDeleteStatus(String indId,String status) {
baseIndDefVersionDataMapper.updateIsDeleteStatus(indId, status);
}
} }
...@@ -137,6 +137,7 @@ public class DriveIndDefService { ...@@ -137,6 +137,7 @@ public class DriveIndDefService {
public void delete(String indId) throws Exception{ public void delete(String indId) throws Exception{
driveIndDefMapper.deleteByPrimaryKey(indId); driveIndDefMapper.deleteByPrimaryKey(indId);
driveIndDefVersionService.updateIsDeleteStatus(indId, "1");//标识已删除
} }
public Map<String,Object> getByPageAndKeyword(Integer catalogId,String keyword, public Map<String,Object> getByPageAndKeyword(Integer catalogId,String keyword,
......
...@@ -25,6 +25,7 @@ public class DriveIndDefVersionService { ...@@ -25,6 +25,7 @@ public class DriveIndDefVersionService {
driveIndDefVersionData.setIndId(driveIndDef.getIndId()); driveIndDefVersionData.setIndId(driveIndDef.getIndId());
driveIndDefVersionData.setIndName(driveIndDef.getIndName()); driveIndDefVersionData.setIndName(driveIndDef.getIndName());
driveIndDefVersionData.setVersion(driveIndDef.getVersion()); driveIndDefVersionData.setVersion(driveIndDef.getVersion());
driveIndDefVersionData.setIsDelete("0");//未删除
GsonBuilder gsonBuilder = new GsonBuilder(); GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.setPrettyPrinting(); gsonBuilder.setPrettyPrinting();
Gson gson = gsonBuilder.create(); Gson gson = gsonBuilder.create();
...@@ -36,4 +37,8 @@ public class DriveIndDefVersionService { ...@@ -36,4 +37,8 @@ public class DriveIndDefVersionService {
public List<DriveIndDefVersionData> getVersionDataByIndId(String indId){ public List<DriveIndDefVersionData> getVersionDataByIndId(String indId){
return driveIndDefVersionDataMapper.getVersionDataByIndId(indId); return driveIndDefVersionDataMapper.getVersionDataByIndId(indId);
} }
public void updateIsDeleteStatus(String indId,String status) {
driveIndDefVersionDataMapper.updateIsDeleteStatus(indId, status);
}
} }
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData"> <select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData">
select * select *
from base_ind_def_version_data from base_ind_def_version_data
where ind_id=#{indId} where ind_id=#{indId} and is_delete='0'
</select> </select>
<update id="updateIsDeleteStatus">
update base_ind_def_version_data set is_delete=#{status} where ind_id=#{indId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData"> <select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData">
select * select *
from drive_ind_def_version_data from drive_ind_def_version_data
where ind_id=#{indId} where ind_id=#{indId} and is_delete='0'
</select> </select>
<update id="updateIsDeleteStatus">
update drive_ind_def_version_data set is_delete=#{status} where ind_id=#{indId}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment