如何在SQL中使用costumon功能作为查询条件

时间:2019-05-16 10:49:00

标签: mybatis

如何在mybatis中使用自定义函数作为查询表。我希望有一个朋友可以解决这个问题。谢谢!

        select
        t1.ELECTRONICSNAME,
        t1.organName,
        decode(t1.sex,0,'男','女') sex,
        nvl(t1.criminal,' ') CRIMINAL,
        t1.telephone,
        t1.positionInfo,
        t1.longitude,
        t1.latitude
        (
         SELECT LISTAGG(B.BORDERNAME,',') WITHIN GROUP(ORDER BY B.BORDERNAME) BORDERNAME
          FROM t_Sqjz_Bordersetting_Other BS
          LEFT JOIN (SELECT BORDERNAME, BORDERID
                      FROM t_Sqjz_Border_Other T
                     GROUP BY BORDERNAME, BORDERID) B
            ON BS.BORDERID = B.BORDERID
         WHERE BS.Relationid = T1.ELECTRONICSID
         and BS.Type = 0

         ) BORDERNAME,
         NVL(t1.POSITIONID,-1) ID,
         case when t1.POSITIONINFO is null then 1 else 0 end  positioninfo_status,
        sr.simcode,
        t1.tableName
        from
         table (SELECT_NEWEST_P4DESK(#{organId},null,null,null,
        #{state},null,#{locateType},0,0,#{endRecord})
        ) t1
        left join t_SQJZ_RYMC sr
        on t1.electronicsId=sr.id

0 个答案:

没有答案