getList.md 2.73 KB

查询评论

接口名: `/guang/comment/getList

方法

POST

入参


属性名称 类型 例子 说明 是否必填 长度限制
status Integer 1 状态 1-2
condNum int 2 1-1
condContent String xx 查询内容 1-128

对应SQL的操作库表

<select id="selectCountByCondition" resultType="java.lang.Integer" >
    select 
    IFNULL(count(1),0)
    from comments
    where 1=1
    <if test="status != null" >
       and audit_status = #{status,jdbcType=TINYINT}
    </if>
    <if test="condContent != null and condNum ==1" >
       and content like concat('%', #{condContent}, '%')
    </if>
    <if test="condContent != null and condNum ==2" >
       and username = #{condContent}
    </if>
    <if test="condContent != null and condNum ==3" >
       and uid = #{condContent}
    </if>
    <if test="condContent != null and condNum == 4" >
       and article_title like concat('%', #{condContent}, '%')
    </if>
    <if test="condContent != null and condNum == 5" >
       and editor_name = #{condContent}
    </if>
</select>
<select id="selectListByCondition" resultMap="BaseResultMap" >
    select 
    <include refid="Base_Column_List" />
    from comments
    where 1=1
    <if test="status != null" >
       and audit_status = #{status,jdbcType=TINYINT}
    </if>
    <if test="condContent != null and condNum ==1" >
       and content like concat('%', #{condContent}, '%')
    </if>
    <if test="condContent != null and condNum ==2" >
       and username = #{condContent}
    </if>
    <if test="condContent != null and condNum ==3" >
       and uid = #{condContent}
    </if>
    <if test="condContent != null and condNum == 4" >
       and article_title like concat('%', #{condContent}, '%')
    </if>
    <if test="condContent != null and condNum == 5" >
       and editor_name = #{condContent}
    </if>
    order by id DESC limit #{offset},#{size}
</select>

错误编码


错误码code 消息 说明
200 操作成功

返回

json

{
    "code": 200,
    "data": [
        {
            "id": "1",
            "condNum": "222",
            "condContent": "xxxee",
            "status": "1",
        },
        {
            "id": "2",
            "condNum": "212",
            "condContent": "xxxee",
            "status": "1",
        }
    ]
}