<?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="cn.freemud.manager.dao.OpenPlatformWxappPluginBindDao">

  <select id="queryByWxAppid" parameterType="java.lang.String" resultType="cn.freemud.entities.vo.WxappPluginVo">
    SELECT
    t1.id as pluginId,
    t1.nickname as nickname,
    t1.plugin_appid as pluginAppid,
    t2.wechat_act_id as wechatActId,
    IFNULL(t2.audit_status, 0) as auditStatus,
    IFNULL(t2.operate_status, 1) as operateStatus
    FROM open_platform_wxapp_plugin t1
    LEFT JOIN open_platform_wxapp_plugin_bind t2
    ON t1.id = t2.plugin_id
    AND t2.wx_appid = #{wxAppid}
  </select>
</mapper>