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},'%') 
 
posted @   全琪俊  阅读(62)  评论(0编辑  收藏  举报
编辑推荐:
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!
点击右上角即可分享
微信分享提示