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.
78 lines
2.2 KiB
78 lines
2.2 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.CustomerMpDao">
|
|
|
|
<select id="selectByCustomerId" resultType="com.epmet.dto.CustomerMpDTO">
|
|
SELECT
|
|
id,
|
|
customer_id,
|
|
client,
|
|
app_id,
|
|
authorization_flag
|
|
FROM
|
|
customer_mp
|
|
WHERE
|
|
del_flag = '0'
|
|
AND customer_id = #{customerId}
|
|
ORDER BY
|
|
client ASC
|
|
</select>
|
|
<!-- 查询授权的数量 -->
|
|
<select id="selectAuthCount" resultType="java.lang.Integer">
|
|
SELECT
|
|
COUNT(*) AS notAuthCount
|
|
FROM
|
|
customer_mp
|
|
WHERE
|
|
del_flag = '0'
|
|
AND customer_id = #{customerId}
|
|
AND authorization_flag = 0
|
|
</select>
|
|
|
|
<!-- 回填customer_mp的appId -->
|
|
<update id="updateAppIDByCustomerIdAndClient" parameterType="com.epmet.dto.form.AuthCodeFormDTO">
|
|
UPDATE customer_mp
|
|
SET app_id = #{authAppId},authorization_flag = 1
|
|
WHERE
|
|
customer_id = #{customerId}
|
|
AND del_flag = '0'
|
|
AND client = #{client}
|
|
</update>
|
|
|
|
<!-- 修改小程序授权的状态 -->
|
|
<update id="updateAuthorizationFlag">
|
|
UPDATE customer_mp
|
|
SET authorization_flag = 0
|
|
WHERE
|
|
app_id = #{authAppId}
|
|
</update>
|
|
|
|
<!-- 根据 客户Id和授权方AppId查询clientType -->
|
|
<select id="selectClientTypeByCustomerIdAndAuthId" resultType="java.lang.String">
|
|
SELECT
|
|
client_type AS clientType
|
|
FROM
|
|
customer_mp
|
|
WHERE
|
|
del_flag = '0'
|
|
AND customer_id = #{customerId}
|
|
AND app_id = #{authAppId}
|
|
</select>
|
|
|
|
<select id="selectAll" resultType="com.epmet.dto.CustomerMpDTO">
|
|
SELECT
|
|
id,
|
|
customer_id,
|
|
client,
|
|
app_id,
|
|
authorization_flag
|
|
FROM
|
|
customer_mp
|
|
WHERE
|
|
del_flag = '0'
|
|
ORDER BY
|
|
customer_id ASC, client ASC
|
|
</select>
|
|
|
|
</mapper>
|