onlyWhereSql=false

https://doc.rg1008.com/docs/rg_pass_api/rg_pass_api-1e0far69vp4j4

onlyWhereSql=true

注意 {s-if:_mapperType}{op-eq:ch} SQL语句 {op-eq:ch}{e-if:_mapperType}
{
  "responseField": {
    "view": {
      "auth": true,
      "isList": true,
      //开启只执行responseField里面配置
      //"onlySqlList": true,
      "selectSql": {
      },
      "show": "scripture_id,scripture_name,word_no,all_word_no,type,words,words_type",
      // 只使用 wheres 里面组合语句
      "onlyWhereSql": true,
      //#region _mapperType
      "mappers": {
        // 默认
        //"default": {
        //  "columnAlias": "title,sign,open_method,notice_id,img_url,content"
        //},
        // 首页
        "home": {
          "columnAlias": "scripture_id,scripture_name,scripture_full_name,img_url,sort_id,tag,vip_level,jd_type,worshiped_num,show_num"
        },
        // 我的
        "my": {
          "columnAlias": "scripture_id,scripture_name,scripture_full_name,img_url,sort_id,tag,vip_level,jd_type,worshiped_num,show_num,word_no,all_word_no",
          "showExtand": "{word_no},{all_word_no}"
        }
      },
      //#endregion _mapperType
      "wheres": [
        // #region 首页
        "{s-if:_mapperType}",
        "{op-eq:home}",
        " select scripture_id,scripture_name,scripture_full_name,img_url,sort_id,tag,vip_level,jd_type,worshiped_num,show_num from zt_scripture where is_enabled=1 and {where_sql} order by sort_id",
        "{op-eq:home}",
        "{e-if:_mapperType}",
        // #endregion 首页
        // #region 我的经文 not exists
        "{s-if:_mapperType}",
        "{op-eq:my}",
        " select scripture_id,scripture_name,scripture_full_name,img_url,sort_id,tag,vip_level,jd_type,worshiped_num,show_num,{word_no},{all_word_no} from zt_scripture where is_enabled=1 and {where_sql} and scripture_id in (select scripture_id from zt_scripture_user where user_id=@_userId) order by sort_id",
        "{op-eq:my}",
        "{e-if:_mapperType}",
        // #endregion 我的经文
        // #获取经文详细信息  用户平台配置信息
        "{s-if:_mapperType}{op-eq:uc} ",
        "  select config_id,words_pre_day,times_per_day,jump_type,once_seconds,line_words,end_space,word_space,up_space,down_space,word_ship_space from zt_user_config where config_id=1",
        " union",
        "  select config_id,words_pre_day,times_per_day,jump_type,once_seconds,line_words,end_space,word_space,up_space,down_space,word_ship_space from zt_user_config where loign_id=@_userId ",
        "{op-eq:uc}{e-if:_mapperType}",
        // #经文名   设置经典初始值  总字数 总汉字数
        "{s-if:_mapperType}{op-eq:jd} ",
        " select scripture_name,0 word_no,0 all_word_no, 'jwmc' type  from zt_scripture where scripture_id = @scriptureId",
        " union",
        " select null scripture_name,count(scripture_did) word_no, 0 all_word_no,'zzs' type  from zt_scripture_detail where scripture_id = @scriptureId",
        " union",
        " select null scripture_name,0 word_no,count(scripture_did) all_word_no, 'zhzs' type  from zt_scripture_detail where word_type =1 and scripture_id = @scriptureId",
        " union",
        " select null scripture_name,word_no,all_word_no,'curposition' type from zt_curposition where login_id=@_userId and scripture_id = @scriptureId ",
        "{op-eq:jd}{e-if:_mapperType}",
        // #经文名   设置忏悔初始值  总字数 总汉字数
        "{s-if:_mapperType}{op-eq:ch} ",
        " select scripture_name,0 word_no,0 all_word_no, 'jwmc' type  from zt_scripture where scripture_id = @scriptureId",
        " union",
        " select null scripture_name,count(rep_id) word_no, 0 all_word_no,'zzs' type  from zt_repentance where scripture_id = @scriptureId",
        " union",
        " select null scripture_name,0 word_no,count(rep_id) all_word_no, 'zhzs' type  from zt_repentance where scripture_id = @scriptureId",
        " union",
        " select null scripture_name,word_no,all_word_no,'curposition' type from zt_curposition where login_id=@_userId and scripture_id = @scriptureId ",
        "{op-eq:ch}{e-if:_mapperType}",
        // #获取经文详细信息   122:(ilinefirst + iLineCount).ToString()   113 iShowNum.ToString() 
        "{s-if:_mapperType}{op-eq:detail} ",
        "  select b.words,b.word_no from",
        " (",
        "  select  a.* from ",
        " (",
        " select  words,word_no,scripture_did,sort_id from zt_scripture_detail where scripture_id =@scriptureId order by sort_id asc limit @lineNum",
        "  ) a order by a.sort_id desc limit @showNum",
        " ) b",
        "  order by b.sort_id ",
        "{op-eq:detail}{e-if:_mapperType}",
        // #拜忏文字信息
        "{s-if:_mapperType}{op-eq:bcwords} ",
        " select words from zt_repentance where  scripture_id = @scriptureId and word_no = @wordNo",
        "{op-eq:bcwords}{e-if:_mapperType}",
        // #拜忏文字信息 每次前/每字前/每字后/每次后
        "{s-if:_mapperType}{op-eq:aidwords} ",
        " select words,words_type from zt_aid_words where  scripture_id = @scriptureId and word_no = @wordNo",
        "{op-eq:aidwords}{e-if:_mapperType}"
      ]
    }
  },
  "columns": {
    "wordNo": {
      "extendAlias": "input_basis",
      "fieldSort": 9999,
      "tableId": 1,
      "dataType": "varchar",
      "title": "已拜索引",
      "isData": false,
      "filter": {
        "isMust": false
      },
      "sql": "(select max(word_no) from zt_curposition tb_b where login_id=@_userId and zt_scripture.scripture_id = tb_b.scripture_id) word_no",
      "selectSql": {
        "oracle": null,
        "sqlserver": null,
        "mysql": null,
        "sqlite": null
      },
      "field": "wordNo",
      "name": "word_no",
      "alias": "word_no",
      "isDate": false,
      "isPrimary": false,
      "isIdentity": false,
      "maxLength": 200
    },
    "allWordNo": {
      "extendAlias": "input_basis",
      "fieldSort": 9999,
      "tableId": 1,
      "dataType": "varchar",
      "title": "总字数",
      "isData": false,
      "filter": {
        "isMust": false
      },
      "sql": "(select count(scripture_did) from zt_scripture_detail tb_b where tb_b.scripture_id = zt_scripture.scripture_id) all_word_no",
      "selectSql": {
        "oracle": null,
        "sqlserver": null,
        "mysql": null,
        "sqlite": null
      },
      "field": "allWordNo",
      "name": "all_word_no",
      "alias": "all_word_no",
      "isDate": false,
      "isPrimary": false,
      "isIdentity": false,
      "maxLength": 200
    }
  }
}
文档更新时间: 2023-06-12 19:33   作者:admin