forked from rongchao/epmet-cloud-rizhao
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.3 KiB
70 lines
2.3 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.epmet.dao.ExternalAppDao">
|
|
|
|
<resultMap type="com.epmet.entity.ExternalAppEntity" id="externalAppMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="appName" column="APP_NAME"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="customerType" column="CUSTOMER_TYPE"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!-- appName和客户ID查询-->
|
|
<select id="countByAppNameAndCustomerId" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(0)
|
|
FROM
|
|
external_app
|
|
WHERE
|
|
APP_NAME = #{appName}
|
|
AND CUSTOMER_ID = #{customerId}
|
|
AND DEL_FLAG = 0
|
|
</select>
|
|
|
|
<select id="list" resultType="com.epmet.dto.result.ExternalAppResultDTO">
|
|
SELECT
|
|
ea.ID appId,
|
|
ea.APP_NAME,
|
|
ea.CUSTOMER_ID,
|
|
ec.CUSTOMER_NAME ,
|
|
ea.CUSTOMER_TYPE,
|
|
eas.SECRET
|
|
FROM
|
|
external_app ea
|
|
LEFT JOIN external_customer ec ON ( ea.CUSTOMER_ID = ec.ID )
|
|
LEFT JOIN external_app_secret eas ON (ea.ID = eas.APP_ID)
|
|
<where>
|
|
ea.DEL_FLAG = 0
|
|
<if test="customerId != null and customerId != ''">
|
|
AND ea.CUSTOMER_ID = #{customerId}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="getByNameAndCustomerId" resultType="com.epmet.dto.result.ExternalAppResultDTO">
|
|
SELECT
|
|
ID AS appId,
|
|
APP_NAME ,
|
|
CUSTOMER_ID
|
|
FROM
|
|
external_app
|
|
WHERE
|
|
APP_NAME = #{appName}
|
|
AND
|
|
CUSTOMER_ID = #{customerId}
|
|
AND DEL_FLAG = 0
|
|
</select>
|
|
|
|
<select id="getCustomerIds" resultType="java.lang.String">
|
|
SELECT CUSTOMER_ID FROM external_app WHERE DEL_FLAG = 0
|
|
</select>
|
|
|
|
|
|
</mapper>
|