日照智慧社区接口服务
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.
 
 
 
 
 

80 lines
2.6 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.MiniInfoDao">
<!-- 插入小程序信息 -->
<insert id="insertMiniInfo">
<selectKey keyProperty="id" order="AFTER" resultType="String">
SELECT id AS id from mini_info where del_flag = 0 and customer_id = #{customerId} and client_type = #{clientType} order by created_time desc limit 1
</selectKey>
INSERT INTO mini_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME,
PRINCIPAL_NAME, SIGNATURE, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{customerId},
#{clientType},
#{nick_name},
#{head_img},
#{service_type_info},
#{verify_type_info},
#{user_name},
#{principal_name},
#{signature},
#{qrcode_url},
#{delFlag},
#{revision},
#{createdBy},
NOW(),
#{updatedBy},
NOW()
)
</insert>
<update id="updateNickName">
update mini_info
set NICK_NAME = #{nickName}
where CUSTOMER_ID = #{customerId}
and CLIENT_TYPE = #{clientType}
and DEL_FLAG = '0'
</update>
<!-- 删除小程序信息 -->
<delete id="deleteMiniInfo">
DELETE
FROM
mini_info
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND client_type = #{clientType}
</delete>
<!-- 根据原始ID查询 customerId 和 clientType -->
<select id="selectCustomerIdAndClientByToUserName" resultType="com.epmet.dto.result.CustomerIdAndClientResultDTO">
SELECT
customer_id AS customerId,
client_type AS clientType
FROM
mini_info
WHERE
del_flag = 0
AND user_name = #{toUserName}
UNION ALL
SELECT
customer_id AS customerId,
client_type AS clientType
FROM
pa_info
WHERE
del_flag = 0
AND user_name = #{toUserName}
LIMIT 1
</select>
<select id="getNickName" resultType="java.lang.String">
select NICK_NAME from mini_info
where DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
</select>
</mapper>