mybatis常用
#{userId,jdbcType=NUMERIC},#{orgId,jdbcType=NUMERIC},
#{createTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=NUMERIC},
CONCAT(
(select o1.CRORG_NAME from core_organization o1 where 1=1 and o1.CRORG_UUID= substring_index(t.CRACT_ORG_OWNERS,',', 0)),
(select o1.CRORG_NAME from core_organization o1 where 1=1 and o1.CRORG_UUID= substring_index(t.CRACT_ORG_OWNERS,',', 1))
)
<if test="ruleArray != null">
AND
<foreach collection="ruleArray" item="item" index="index" open="(" separator="or" close=")">
JSON_EXTRACT ( content, #{fieldUuid} ) LIKE #{item}
</foreach>
</if>
SELECT JSON_EXTRACT('{"uid":"asas02234"}', "$.uid");
由于json的键值是带双引号。所以需要去掉双引号。
select replace(JSON_EXTRACT(infoJson,'$.uid'),'"','') uid from users
<if test="orgIds != null and orgIds.size>0">
cap.org_id in
<foreach collection="orgIds" item="item" open="(" separator="," close=")" >
#{item}
</foreach>
and
</if>
AND cm.custom_name like CONCAT('%',#{ customName},'%')

浙公网安备 33010602011771号