zoukankan      html  css  js  c++  java
  • mybatis02 --- 一对多,collection中嵌套select

        <resultMap id="getUnSendTemplateMessagesMap" extends="baseMap"
                   type="cn.kz.b1.common.model.wechat.WechatTemplateMessage">
            <collection column="id" property="users" select="getTemplateUsers"></collection>
        </resultMap>
    
        <select id="getTemplateUsers" resultMap="templateUser">
            SELECT template_id,user_id,openid ,app_id,unionid,wx_openid,student_id,realname,status
            FROM xx_template_user
            WHERE template_id = #{id}
        </select>
    
        <select id="getUnSendTemplateMessages" resultMap="getUnSendTemplateMessagesMap">
            SELECT id,UUID,school_id,TYPE,STATUS,title,type_name,
                    content,params,remark,create_person,create_time,modify_time,modify_person
            FROM xx_template_message
            WHERE status = 0
        </select>
    
        <resultMap id="ExamResultMapCondition" type="cn.kiway.czgj.common.vo.clazz.CzgjExaminationVo"
                   extends="BaseResultMap">
            <result column="createPersonName" property="createPersonName"/>
            <result column="classId" property="classId"/>
            <!-- examinationId是当前map获得的参数;id是入参,外循环传入-->
            <collection column="{examinationId=id,classId=classId}" property="classList" 
                        select="selectExamClassByExamIdClassId" javaType="ArrayList"/>
            <collection column="{examinationId=id}" property="subjectList" select="selectExamSubject" javaType="ArrayList"/>
        </resultMap>
    
  • 相关阅读:
    Android smali 语法
    iOS 发布计费点测试
    how-to-stop-non-jailbroken-pirates-theory
    shell script
    文章收藏
    NB BAT批量读取图片文件属性
    JAVA LUHN
    MAC NDK 编译 Cocos2dx 问题
    Mac 下解压缩安装Android ndk bin 文件
    MVC Json输出调试信息
  • 原文地址:https://www.cnblogs.com/kltsee/p/13963757.html
Copyright © 2011-2022 走看看