SELECT*from idp_measure_point where alarm_config_json isnotnulland json_extract_path(alarm_config_json::json#>'{threshold, 1}', 'threshold_type')::text='"TIMING"' ORDER BY create_time desc;
Mybatis 里SQL写法,json字段过滤
<select id="selectPushDataList" resultMap="BaseResultMap" parameterType="com.jpc.JpushData" >
SELECT
<include refid="Base_Column_List" />
FROM
jp_push jpt
<where>
delete_flag=1
and (jpt.rule ->> 'sendType' )::text = 'tag'
<if test="name != null and name !=''" >
and name =#{name,jdbcType=VARCHAR}
</if>
ORDER BY
create_time ASC
LIMIT ${pageSize} OFFSET ${(currentPage - 1) * pageSize}
</where>
</select>