• 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>
    
  • 相关阅读:
    PHP页面静态化
    PHP实现单文件、多文件上传 封装 面向对象实现文件上传
    PHP MYSQL
    MySQL 数据表
    MySQL基础
    DOM事件处理程序-事件对象-键盘事件
    JS--显示类型转换Number—隐式类型转换
    JS的数据类型
    JS属性读写操作+if判断注意事项
    Javascript进阶篇——总结--DOM案例+选项卡效果
  • 原文地址:https://www.cnblogs.com/kltsee/p/13963757.html
Copyright © 2020-2023  润新知