|
@@ -94,10 +94,10 @@ public class DesignPic extends Controller {
|
|
|
"sat_sharematerialid", "createuserid", "createby", "createdate", "changeby", "changedate", "checkby", "checkdate", "sys_enterpriseid", "title", "type", "sequence", "status"
|
|
|
, "title_c", "renderingsclass", "isnationwide", "collectcount", "likecount", "commentcount", "panoramaurl")
|
|
|
.setTableAlias("t1");
|
|
|
- querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
|
|
|
+ querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and t2.type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
|
|
|
querySQ.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t1.sys_enterpriseid and t3.siteid=t1.siteid"
|
|
|
, "enterprisename");
|
|
|
- querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
|
|
|
+ querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and t4.type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
|
|
|
querySQ.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
|
|
|
querySQ.addQueryFields("islike", "CASE WHEN t4.sys_datacollectid>0 THEN 1 ELSE 0 END");
|
|
|
querySQ.setSiteid(siteid);
|
|
@@ -119,6 +119,7 @@ public class DesignPic extends Controller {
|
|
|
|
|
|
|
|
|
Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
|
|
|
+ attRows.sortby("sequence","linksid");
|
|
|
detailRow.put("attinfos", attRows);
|
|
|
detailRow.putIfAbsent("areaname", "");
|
|
|
detailRow.putIfAbsent("checkdate", "");
|
|
@@ -134,7 +135,7 @@ public class DesignPic extends Controller {
|
|
|
attachmentQuery.setWhere("ownertable", ownertable);
|
|
|
attachmentQuery.setWhere("ownerid", sat_sharematerialid);
|
|
|
attachmentQuery.setWhere("usetype", ownertable);
|
|
|
- attachmentQuery.setOrderBy("t1.sequence");
|
|
|
+ attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
|
|
|
Rows attachmentRows = attachmentQuery.query();
|
|
|
|
|
|
|
|
@@ -269,8 +270,9 @@ public class DesignPic extends Controller {
|
|
|
// 附件
|
|
|
RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
|
|
|
for (Row row : rows) {
|
|
|
- Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
- row.put("attinfos", Rows);
|
|
|
+ Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
+ attinfosRows.sortby("sequence","linksid");
|
|
|
+ row.put("attinfos", attinfosRows);
|
|
|
row.putIfAbsent("checkdate", "");
|
|
|
if (StringUtils.isBlank(row.getString("panoramaurl"))) {
|
|
|
row.put("ispanorama", 0);
|
|
@@ -357,10 +359,10 @@ public class DesignPic extends Controller {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, sat_sharematerial,
|
|
|
"sat_sharematerialid", "title", "title_c", "commentcount", "likecount", "collectcount", "createuserid", "createby", "createdate")
|
|
|
.setTableAlias("t1");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and t2.type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t3", "t3.sys_enterpriseid=t1.sys_enterpriseid and t3.siteid=t1.siteid"
|
|
|
, "enterprisename", "sys_enterpriseid");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sys_datacollect", "t4", "t4.siteid=t1.siteid and t4.ownertable='sat_sharematerial' and t4.type=2 and t4.ownerid=t1.sat_sharematerialid and t4.userid='" + userid + "'");
|
|
|
querySQL.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
|
|
|
querySQL.addQueryFields("islike", "CASE WHEN t4.sys_datacollectid>0 THEN 1 ELSE 0 END");
|
|
|
querySQL.setSiteid(siteid);
|
|
@@ -374,8 +376,9 @@ public class DesignPic extends Controller {
|
|
|
// 附件
|
|
|
RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
|
|
|
for (Row row : rows) {
|
|
|
- Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
- row.put("attinfos", Rows);
|
|
|
+ Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
+ attinfosRows.sortby("sequence","linksid");
|
|
|
+ row.put("attinfos", attinfosRows);
|
|
|
row.put("headpic", getHeadPic(row.getLong("createuserid")));
|
|
|
|
|
|
|
|
@@ -434,8 +437,9 @@ public class DesignPic extends Controller {
|
|
|
// 附件
|
|
|
RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
|
|
|
for (Row row : rows) {
|
|
|
- Rows Rows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
- row.put("attinfos", Rows);
|
|
|
+ Rows attinfosRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
|
|
|
+ attinfosRows.sortby("sequence","linksid");
|
|
|
+ row.put("attinfos", attinfosRows);
|
|
|
}
|
|
|
|
|
|
|