yujian
2019-02-15 05ddd297f309d6ec0d5994f7f6cc3547ea64a683
移动端帮助中心
2个文件已修改
19 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java
@@ -39,7 +39,8 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize,    String key, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize,    String key, Long cid,
            PrintWriter out) {
        
        try {
            
@@ -49,15 +50,19 @@
            if (pageSize == null) 
                pageSize = Constant.PAGE_SIZE;
            
            if (cid != null && cid == 0) {
                cid = null; // 查询全部
            }
            List<HelpCenter> helpCenterList = 
                    helpCenterService.queryIdAndTitle((pageIndex - 1) * pageSize, pageSize, key, null);
                    helpCenterService.queryIdAndTitle((pageIndex - 1) * pageSize, pageSize, key, cid);
            
            if (helpCenterList == null || helpCenterList.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
                return;
            } 
            
            long count = helpCenterService.countQuery(key, null);
            long count = helpCenterService.countQuery(key, cid);
                
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count    / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/mapping/help/HelpCenterMapper.xml
@@ -59,7 +59,7 @@
              AND ht.h_title like '%${key}%'
       </if>
       <if test='cid != null'>
              AND ht.h_cid  = cid
              AND ht.h_cid = #{cid}
       </if>
       
       <if test='orderMode == 1'>
@@ -94,19 +94,19 @@
              AND h_title like '%${key}%'
       </if>
       <if test='cid != null'>
              AND h_cid  = cid
              AND h_cid  = #{cid}
       </if>
    </select>
    
     <select id="queryIdAndTitle" resultMap="BaseResultMap">
      <!-- 根据条件查询所有标签 -->
    SELECT  h_id, h_title FROM yeshi_ec_help_center    
        WHERE     <![CDATA[1>0]]>
        WHERE 1=1
       <if test='key != null and key != ""'>
              AND h_title like '%${key}%'
       </if>
       <if test='cid != null'>
              AND h_cid  = cid
              AND h_cid  = #{cid}
       </if>
        ORDER BY  h_weight  DESC, h_createtime