Commit 78c0c4d4 by 周添尉

完成应用管理的查找,安装,卸载

parent 7cd27cde
......@@ -28,12 +28,9 @@ function init_index_nav(){
for(var i = 0;i<data.length;i++){
var text = $('<a></a>').text(data[i].NAME).data('uuid',data[i].UUID);
if(i==0){
text.attr('href','index.jsp');
text.addClass('layout_center_navClick');
}
else{
text.attr('href','index2.jsp');
}
text.attr('href',data[i].REMARK);
container.append(text);
}
}
......
......@@ -9,7 +9,7 @@
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/fancyBox/js/jquery.fancybox.js?v=2.1.3"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/fancyBox/js/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/fancyBox/js/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/fancyBox/js/jquery.fancybox-media.js?v=1.0.5"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/1lib/plug/fancyBox/js/jquery.fancybox-media.js?v=1.0.5"></script>
<!-- xcConfirm的js -->
<script src="${pageContext.request.contextPath}/lib/plug/xcConfirm/js/xcConfirm.js"></script>
<!-- 调用api时的js -->
......@@ -153,13 +153,14 @@ a{
height:100%;
}
.index_application_show_tabs_content_div>div:first-child{
border:1px solid #ccc;
border-radius:10px;
width:60px;
height:60px;
margin:10px auto 5px;
background:white;
padding:10px;
border-radius: 10px;
width: 60px;
height: 60px;
margin: 10px auto 5px;
border-radius: 10px;
}
.index_application_show_tabs_content_div>div:first-child>img{
border-radius:13px;
}
.index_application_show_tabs_content_text{
text-align:center;
......@@ -319,11 +320,12 @@ $(function(){
$(this).addClass('index_application_show_tabs_click');
//apps的切换
index_application_toggle();
})
})
//安装获得卸载
//安装或者卸载
function index_application_isLoad(handler){
var txt;
var option;
......@@ -341,8 +343,10 @@ function index_application_isLoad(handler){
//保存到数据库
jwAppAppsModel.jwAppsAppsActAction.insert_unInstallApp_byResourceId({
RESOURCE_ID:$(handler).parent().parent().data('app').RESOURCE_ID
APP_ID:$(handler).parent().parent().data('app').APP_ID
});
//绑定一个data来区别是否已经安装1为安装,0为未安装
$(handler).parent().parent().data('app').CUSTOM_INSTALL='0';
$('.fancybox-iframe',window.parent.document).parent().parent().parent().find('.fancybox-close').unbind().bind('click',function(event){
event.stopPropagation();
......@@ -369,6 +373,12 @@ function index_application_isLoad(handler){
$(handler).parent().parent().hide();
}
//保存到数据库
jwAppAppsModel.jwAppsAppsActAction.insert_installApp_byResourceId({
APP_ID:$(handler).parent().parent().data('app').APP_ID
});
//绑定一个data来区别是否已经安装1为安装,0为未安装
$(handler).parent().parent().data('app').CUSTOM_INSTALL='1';
$('.fancybox-iframe',window.parent.document).parent().parent().parent().find('.fancybox-close').unbind().bind('click',function(event){
event.stopPropagation();
......@@ -388,12 +398,19 @@ function index_application_isLoad(handler){
//关闭后重新渲染应用中心
function index_application_close(){
console.log('关闭')
var app_data=[];
$('.index_application_show_tabs_content>div').each(function(index,elemet){
if($(elemet).find('.index_application_show_tabs_content_img>span').text()=='卸载'){
app_data.push($(elemet).data('app'));
}
})
//初始化应用,调用父元素的方法
parent.window.init_index_application(app_data);
}
//初始化类别
function init_index_categorys(){
var list_category = list_allApps.types;
var list_category = list_allApps.types.rowSet;
var index_application_show_tabs = $('.index_application_show_tabs');
index_application_show_tabs.append('<span class="index_application_show_tabs_click">全部应用</span>');
for(var i = 0 ; i<list_category.length;i++){
......@@ -419,7 +436,7 @@ function init_index_apps(){
appsContainer.append(createContainer);
var index_application_show_tabs_content_div= $('<div class="index_application_show_tabs_content_div"></div>');
createContainer.append(index_application_show_tabs_content_div);
var app_img = $('<div><img src="'+ctx+'/custom/images/index_application_img.png" width="40" height="40"/></div>');
var app_img = $('<div><img src="'+ctx+'/photo/photo.jsp?ls_photo='+ apps[i].IMG_ID_S +'" width="60" height="60"/></div>');
var app_text1=$('<div class="index_application_show_tabs_content_text"></div>').text(apps[i].NAME);
var app_text2=$('<div class="index_application_show_tabs_content_text" style="margin-top:2px;"></div>');
//判断是用户安装的还是系统自带的
......@@ -432,10 +449,16 @@ function init_index_apps(){
var app_isInstall = $('<div class="index_application_show_tabs_content_img" onclick="index_application_isLoad(this)"><img src="'+ ctx +'/custom/images/index_application_unLoad.png" width="16" height="16"/><span>卸载</span></div>');
//判断是否卸载
if(!apps[i].USERID){
//先处理下数据,如果是安装的那就加一个属性CUSTOMINSTALL为1,否则为0
apps[i].CUSTOM_INSTALL='0';
app_isInstall.css('background','#1887f6');
app_isInstall.find('img').attr('src',ctx+'/custom/images/index_application_load.png');
app_isInstall.find('span').text('安装');
}
else{
//先处理下数据,如果是安装的那就加一个属性CUSTOMINSTALL为1,否则为0
apps[i].CUSTOM_INSTALL='1';
}
index_application_show_tabs_content_div.append(app_img).append(app_text1).append(app_text2).append(app_isInstall);
}
}
......@@ -456,7 +479,7 @@ function index_application_toggle(){
$('.index_application_show_tabs_content>div').each(function(index,element){
$(element).show();
//隐藏已经安装的
if($(element).data('app').USERID){
if($(element).data('app').CUSTOM_INSTALL=='1'){
$(element).hide();
}
//再隐藏不符合tabs的
......@@ -471,7 +494,7 @@ function index_application_toggle(){
$('.index_application_show_tabs_content>div').each(function(index,element){
$(element).show();
//隐藏未安装的
if(!$(element).data('app').USERID){
if($(element).data('app').CUSTOM_INSTALL=='0'){
$(element).hide();
}
//再隐藏不符合tabs的
......
......@@ -495,6 +495,7 @@ a{
.index_container_application_text img{
display:block;
margin:44px auto 15px;
border-radius: 10px;
}
.index_container_application>div{
margin-bottom:20px;
......@@ -744,6 +745,7 @@ a{
height:25px;
ontline:none;
width:120px;
cursor: pointer;
}
.index_module_insertBtn{
font-size: 18px;
......@@ -767,6 +769,17 @@ a{
line-height: 20px;
margin-top: 10px;
}
.index_application_noApp{
margin-top:20px;
font-size:18px;
display:inline-block;
border-bottom:2px solid white;
cursor: pointer;
}
.index_application_noApp:hover{
color:#1887f6;
border-bottom:2px solid #1887f6;
}
/********************超过1200px的屏幕时******************/
@media screen and (min-width:1200px){
.index_container_application_text>div{
......
......@@ -533,6 +533,12 @@ function index_update_module(handler){
//2.存放到数据库
var portlets=[];
for(var i=0;i<newJson.length;i++){
//如果是新增模块时
if(!newJson[i]){
$.fancybox.open('<div style="color: #1887f6;font-weight: bold;font-size:18px;line-height:30px;">还有资源没有选择...</div>');
setTimeout('$.fancybox.close();index_module_edit()',1000);
return;
}
var requestObj={};
requestObj.PORTLET_ID=newJson[i].PORTLET_ID;
portlets.push(requestObj);
......@@ -580,7 +586,7 @@ function index_cancel_module(handler){
//放大功能
function index_changeBig_calendar(handler){
if($(handler).prevAll('select').css('display')=='inline-block'){
$.fancybox.open('<div style="color: #1887f6;font-weight: bold;font-size:18px;">正处于编辑状态,无法放大...</div>');
$.fancybox.open('<div style="color: #1887f6;font-weight: bold;font-size:18px;line-height:30px;">正处于编辑状态,无法放大...</div>');
setTimeout('$.fancybox.close()',1000);
return;
}
......@@ -891,18 +897,53 @@ function index_application(handler){
}
//初始化应用
function init_index_application(){
var list_allApps = jwAppAppsModel.jwAppsAppsDataAction.list_allApps_by_user({FIELD_COLUMN_ID:$('.layout_center_navClick').data('uuid')}).apps.rowSet;
function init_index_application(data){
var list_row = data;
var app_container = $('.index_container_application_text');
//清空容器
app_container.html('');
//把未安装的app过滤掉
var list_insert = [];
if(!data){
list_row = jwAppAppsModel.jwAppsAppsDataAction.list_allApps_by_user({FIELD_COLUMN_ID:$('.layout_center_navClick').data('uuid')});
var list_allApps = list_row.apps.rowSet;
//flag区分是否存在已经安装的
var flag = true;
for(var j=0;j<list_allApps.length;j++){
if(list_allApps[j].USERID){
list_insert.push(list_allApps[j]);
flag=false;
}
}
//如果没有应用时
if(flag==true){
app_container.append('<span onclick="index_application()" class="index_application_noApp">暂无安装的应用,请去添加...</span>');
return;
}
}
else{
list_insert = list_row;
if(list_insert.length==0){
app_container.append('<span onclick="index_application()" class="index_application_noApp">暂无安装的应用,请去添加...</span>');
return;
}
}
//形成模板
for(var i = 0;i<list_insert.length;i++){
var app_container = $('.index_container_application_text');
var app_div = $('<div></div>');
var app_div = $('<div></div>').data('app',list_insert[i]);
app_div.bind('click',function(){
var data = $(this).data('app');
if(data.IS_POPUP=='1'){
//弹出框
alert('弹出框')
}
else{
//新页面
alert('新页面')
}
});
//每隔5个加个样式
if((i+1)%5==0){
app_div.css('marginRight','0');
......
......@@ -2,14 +2,34 @@
.verticalAlign{ vertical-align:middle; display:inline-block; height:100%; margin-left:-1px;}
.xcConfirm .xc_layer{position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #666666; opacity: 0.5; z-index: 2147000000;}
.xcConfirm .popBox{position: fixed; left: 50%; top: 50%; background-color: #ffffff; z-index: 2147000001; width: 570px; height: 300px; margin-left: -285px; margin-top: -150px; border-radius: 5px; font-weight: bold; color: #535e66;}
/* .xcConfirm .popBox{position: fixed; left: 50%; top: 50%; background-color: #ffffff; z-index: 2147000001; width: 570px; height: 300px; margin-left: -285px; margin-top: -150px; border-radius: 5px; font-weight: bold; color: #535e66;} */
.xcConfirm .popBox{
position: fixed;
left: 50%;
top: 50%;
background-color: #ffffff;
z-index: 2147000001;
width: 570px;
height: 250px;
margin-left: -285px;
margin-top: -125px;
border-radius: 5px;
font-weight: bold;
color: #535e66;
}
.xcConfirm .popBox .ttBox{height: 59px; line-height: 30px; padding: 14px 30px; border-bottom: solid 1px #eef0f1;}
.xcConfirm .popBox .ttBox .tt{font-size: 18px; display: block; float: left; height: 30px; position: relative;}
.xcConfirm .popBox .ttBox .clsBtn{display: block; cursor: pointer; width: 12px; height: 12px; position: absolute; top: 22px; right: 30px; background: url(../img/icons.png) -48px -96px no-repeat;}
/* .xcConfirm .popBox .ttBox .clsBtn:hover{
} */
.xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;}
/* .xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;} */
.xcConfirm .popBox .txtBox{
margin: 30px 100px;
height: 57px;
overflow: hidden;
margin-top: 40px;
}
.xcConfirm .popBox .txtBox .bigIcon{float: left; margin-right: 20px; width: 48px; height: 48px; background-image: url(../img/icons.png); background-repeat: no-repeat; background-position: 48px 0;}
.xcConfirm .popBox .txtBox p{ height: 84px; margin-top: 16px; line-height: 26px; overflow-x: hidden; overflow-y: auto;}
.xcConfirm .popBox .txtBox p input{width: 364px; height: 30px; border: solid 1px #eef0f1; font-size: 18px; margin-top: 6px;}
......
......@@ -6,6 +6,7 @@ import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.AppsBusiness;
import net.sf.json.JSONObject;
......@@ -38,8 +39,10 @@ public class actAction extends BasicAction{
.getBusiness(AppsBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
query.put("APP_ID", RequestUtils.getString(request, "RESOURCE_ID"));
/*business.insert_installApp_byResourceId();*/
//设置当前登陆人
query.put("USER_ID", SessionUtil.getEmid());
query.put("APP_ID", RequestUtils.getString(request, "APP_ID"));
business.insert_installApp(query);
return "json";
}
......@@ -54,8 +57,10 @@ public class actAction extends BasicAction{
.getBusiness(AppsBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
query.put("RESOURCE_ID", RequestUtils.getString(request, "RESOURCE_ID"));
/*business.insert_unInstallApp_byResourceId();*/
//设置当前登陆人
query.put("USER_ID", SessionUtil.getEmid());
query.put("APP_ID", RequestUtils.getString(request, "APP_ID"));
business.insert_unInstallApp(query);
return "json";
}
......
......@@ -2,12 +2,11 @@ package com.jw.app.apps.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONObject;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
......@@ -16,6 +15,8 @@ import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.AppsBusiness;
import com.jw.app.business.utils.QueryParamUtil;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction{
/**
......@@ -57,14 +58,6 @@ public class dataAction extends BasicAction{
public String list_allApps_by_user() throws BusinessException{
jsonObject=new JSONObject();
//1.根据用户id,获取
/*SELECT * FROM (
SELECT ai_in.* FROM app_install ai_in where ai_in.USERID='6666'
) ai
RIGHT JOIN apps_app apps ON ai.APP_ID=apps.APP_ID*/
/*PortletBusiness business = BusinessManager
.getBusiness(PortletBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);*/
AppsBusiness business = BusinessManager
.getBusiness(AppsBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
......@@ -75,32 +68,56 @@ public class dataAction extends BasicAction{
query.put("USER_ID", SessionUtil.getEmid());
List<Map<String, Object>> listData = business
.list_allApps_by_user(query);
for (Map<String, Object> rm : listData) {
if(rm.get("USERID")!=null){
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(listData));
data.put("pageNo", 1);
data.put("pageSize", listData.size());
data.put("pageCount", listData.size());
data.put("rows", data.get("rowSet"));
data.put("total", listData.size());
jsonObject.put("apps",data);
//查找所有的应用所属的类型
//flag=true表示未安装
Boolean flag = true;
//查找所有的app类型
Map<String, Object> queryCategory = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
List<Map<String, Object>> listCategory = business
.list_allCategory(queryCategory);
Map<String, Object> allCategory = new HashMap<String, Object>();
allCategory.put("rowSet", QueryParamUtil.DateToString(listCategory));
allCategory.put("pageNo", 1);
allCategory.put("pageSize", listCategory.size());
allCategory.put("pageCount", listCategory.size());
allCategory.put("rows", allCategory.get("rowSet"));
allCategory.put("total", listCategory.size());
jsonObject.put("types",listCategory);
private_putMapByKey("types",listCategory);
for (Map<String, Object> rm : listData) {
if(rm.get("USERID")!=null){
private_putMapByKey("apps",listData);
flag=false;
/*System.out.println("正常");*/
break;
}
}
//2上述结果中的USERID全部为null,表示一个app都没安装
if(flag==true){
//3.根据用户id来验证apps_uninstall有没有数据
List<Map<String, Object>> listUninstallData = business
.list_allUninstallApps_by_user(query);
if(listUninstallData.size()!=0){
//要把所有的应用都返回出去
Map<String, Object> queryApp = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
List<Map<String, Object>> listAllApps = business
.list_AllApps(queryApp);
/*System.out.println("未安装表里有");*/
private_putMapByKey("apps",listAllApps);
}
else{
//4.如果也没有,表示这个用户是新建用户,需要初始化应用
//5.初始化应用
//6.把默认的app应用添加到install表中
//7.把不默认的app应用添加到uninstall表中
Map<String, Object> queryDefaultApp = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
business.init_defaultApps(queryDefaultApp);
//8.重新查询关联表获得数据
List<Map<String, Object>> defaultData = business
.list_allApps_by_user(query);
/*System.out.println("默认");*/
private_putMapByKey("apps",defaultData);
}
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......@@ -108,14 +125,18 @@ public class dataAction extends BasicAction{
// TODO Auto-generated catch block
e.printStackTrace();
}
//2上述结果中的USERID全部为null,表示一个app都没安装
//3.验证apps_uninstall有没有数据
//4.如果也没有,表示这个用户是新建用户,需要初始化应用
//5.初始化应用
return "json";
}
private void private_putMapByKey(String key,List<Map<String, Object>> list) throws SQLException {
Map<String, Object> listMap = new HashMap<String, Object>();
listMap.put("rowSet", QueryParamUtil.DateToString(list));
listMap.put("pageNo", 1);
listMap.put("pageSize", list.size());
listMap.put("pageCount", list.size());
listMap.put("rows", listMap.get("rowSet"));
listMap.put("total", list.size());
jsonObject.put(key,listMap);
}
}
......@@ -25,4 +25,35 @@ public interface AppsBusiness {
*/
List<Map<String, Object>> list_allCategory(Map<String, Object> query) throws BusinessException ;
/**卸载应用
*
* @param query
*/
void insert_unInstallApp(Map<String, Object> query) throws BusinessException ;
/**安装应用
*
* @param query
*/
void insert_installApp(Map<String, Object> query) throws BusinessException ;
/**根据用户id来查找apps_uninstall的数据
*
* @param query
* @return
*/
List<Map<String, Object>> list_allUninstallApps_by_user(Map<String, Object> query) throws BusinessException ;
/**查找所有的app应用
*
* @param queryApp
* @return
*/
List<Map<String, Object>> list_AllApps(Map<String, Object> query) throws BusinessException ;
/**把默认的app应用添加到install表中并把不默认的app应用添加到uninstall表中
*
* @param queryDefaultApp
*/
void init_defaultApps(Map<String, Object> query) throws BusinessException ;
}
......@@ -2,8 +2,13 @@ package com.jw.app.business.apps;
import java.io.IOException;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.SessionUtil;
......@@ -53,4 +58,114 @@ public class AppsBusinessImpl implements AppsBusiness {
return listData;
}
@Override
public void insert_unInstallApp(Map<String, Object> query) {
//1.先删除安装表里面的数据
appsDAO.delete_installApp(query);
//2.添加未安装表的数据
private_insert_unInstallApp(query);
}
/**添加未安装的数据
*
* @param query
*/
private void private_insert_unInstallApp(Map<String, Object> query) {
Map<String, Object> insertQuery = new HashMap<String, Object>();
insertQuery.put("APP_ID", query.get("APP_ID"));
insertQuery.put("USERID", SessionUtil.getEmid());
insertQuery.put("RESOURCE_ID", UUID.randomUUID().toString());
appsDAO.insert_unInstallApp(mapToList(insertQuery));
}
@Override
public void insert_installApp(Map<String, Object> query) {
//1.先删除未安装表里面的数据
appsDAO.delete_unInstallApp(query);
//2.添加安装表的数据
private_insert_installApp(query);
}
/**添加安装的数据
*
* @param query
*/
private void private_insert_installApp(Map<String, Object> query) {
Map<String, Object> insertQuery = new HashMap<String, Object>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String now = formatter.format(new Date());
insertQuery.put("APP_ID", query.get("APP_ID"));
insertQuery.put("INSTALL_TIME", now);
insertQuery.put("USERID", SessionUtil.getEmid());
insertQuery.put("RESOURCE_ID", UUID.randomUUID().toString());
appsDAO.insert_installApp(mapToList(insertQuery));
}
private List<Map<String, Object>> mapToList(Map<String, Object> map) {
List<Map<String, Object>> entity = new ArrayList<Map<String, Object>>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", entry.getKey());
field.put("value", entry.getValue());
entity.add(field);
}
return entity;
}
@Override
public List<Map<String, Object>> list_allUninstallApps_by_user(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> listData = null;
try {
listData = QueryParamUtil.ClobToString(appsDAO.list_allUninstallApps_by_user(query));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return listData;
}
@Override
public List<Map<String, Object>> list_AllApps(Map<String, Object> query) throws BusinessException {
List<Map<String, Object>> listData = null;
try {
listData = QueryParamUtil.ClobToString(appsDAO.list_AllApps(query));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return listData;
}
@Override
public void init_defaultApps(Map<String, Object> query) throws BusinessException {
try {
//1.先获得所有的apps应用
List<Map<String, Object>> listData = QueryParamUtil.ClobToString(appsDAO.list_AllApps(query));
for(Map<String, Object> data : listData){
Map<String, Object> defaultQuery = new HashMap<String, Object>();
defaultQuery.put("APP_ID",data.get("APP_ID"));
if("0".equals(data.get("IS_DEFAULT"))){
//2.遍历所有的app,如果是默认应用,则添加到install表中
private_insert_installApp(defaultQuery);
}
else{
//3.否则添加到uninstall表中
private_insert_unInstallApp(defaultQuery);
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
......@@ -12,4 +12,15 @@ public interface AppsDAO {
List<Map<String,Object>> list_allCategory(Map<String,Object> query) throws BusinessException ;
void delete_installApp(Map<String, Object> query) throws BusinessException;
void insert_installApp(List<Map<String,Object>> query) throws BusinessException;
void delete_unInstallApp(Map<String, Object> query) throws BusinessException;
void insert_unInstallApp(List<Map<String,Object>> query) throws BusinessException;
List<Map<String,Object>> list_allUninstallApps_by_user(Map<String,Object> query) throws BusinessException ;
List<Map<String,Object>> list_AllApps(Map<String,Object> query) throws BusinessException ;
}
......@@ -3,7 +3,7 @@
<mapper namespace="com.jw.app.business.apps.AppsDAO">
<select id="list_allApps_by_user" parameterType="map"
resultType="upperCaseKeyMap">
SELECT * FROM (
SELECT apps.* , ai.RESOURCE_ID , ai.USERID FROM (
SELECT ai_in.* FROM app_install ai_in where ai_in.USERID=#{USER_ID}
) ai
RIGHT JOIN apps_app apps ON ai.APP_ID=apps.APP_ID
......@@ -14,11 +14,11 @@
SELECT * FROM apps_category
</select>
<delete id="delete_installApp_byResourceId" parameterType="map">
delete from app_install where RESOURCE_ID=#{RESOURCE_ID}
<delete id="delete_installApp" parameterType="map">
delete from app_install where APP_ID=#{APP_ID} and USERID=#{USER_ID}
</delete>
<insert id="insert_installApp_byResourceId" parameterType="java.util.List">
<insert id="insert_installApp" parameterType="java.util.List">
insert into app_install(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
......@@ -34,11 +34,11 @@
<![CDATA[ ) ]]>
</insert>
<delete id="delete_unInstallApp_byResourceId" parameterType="map">
delete from apps_uninstall where RESOURCE_ID=#{RESOURCE_ID}
<delete id="delete_unInstallApp" parameterType="map">
delete from apps_uninstall where APP_ID=#{APP_ID} and USERID=#{USER_ID}
</delete>
<insert id="insert_unInstallApp_byResourceId" parameterType="java.util.List">
<insert id="insert_unInstallApp" parameterType="java.util.List">
insert into apps_uninstall(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
......@@ -54,4 +54,14 @@
<![CDATA[ ) ]]>
</insert>
<select id="list_allUninstallApps_by_user" parameterType="map"
resultType="upperCaseKeyMap">
SELECT * FROM apps_uninstall where USERID=#{USER_ID}
</select>
<select id="list_AllApps" parameterType="map"
resultType="upperCaseKeyMap">
SELECT * FROM apps_app
</select>
</mapper>
\ No newline at end of file
......@@ -94,7 +94,7 @@
<select id="list_portlet_columns" parameterType="map"
resultType="upperCaseKeyMap">
<![CDATA[
select * from portlet_columns pc
select * from portlet_columns pc WHERE parent_id !="0"
]]>
<!-- <trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="NAME != null and NAME != ''">
......
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