exports.gridevents_csglByID = function (req, res, next, id) { // gridevents_csglId var streetid = id; var limit = req.query.limit;// var offset = req.query.offset;//
var sql = 'select * from(
select rownum rw,s.* from (
(select u.username,p.personname,s.streetname,c.communityname,g.gridname,g.gridnum, a.* from wwyt.streetissue a ,wwyt.userinfo u,wwyt.community c,wwyt.street_info s,wwyt.grid g,wwyt.person p where a.streetid = ' + streetid + ' and a.isdelete=0 and issuetype like \'%城理%\' and a.streetid=u.streetid and a.createuser=u.userid and a.communityid=c.communityid and a.streetid=c.streetid and a.communityid=g.departmentid and a.streetid=g.streetid and a.gridid=g.gridid and a.streetid=s.streetid and a.issueobject=p.personid and a.streetid=p.streetid order by a.createdate desc
)s
)
)where rw > '+ limit + ' and rw <= ' + offset;
sequelize.query(sql,
{type: sequelize.QueryTypes.SELECT})
.then(function (infos) {
res.jsonp(infos);}).catch(function (err) {
logger.error('streetissue_ww list error:', err);
return res.status(422).send(err);
});
};