文档章节

MyBATIS的一些记录-2017-3-16

上班不要玩手机
 上班不要玩手机
发布于 2017/03/16 14:33
字数 276
阅读 12
收藏 0

<!-- 获取展示课信息 -->

	<select id="getZskInfo" resultMap="zskResultMap">
	select  
	a.TRAIN_COURSE_DIS_ID AS currId,
	a.SHOWCLASS_NAME as currName,
	a.HIT_NUM as hitNum
	from RAYS02.CMS_SHOWCLASS a LEFT JOIN 
	(select a.id as couId ,a.ispublish as couPublic , a.DELETE_flag as couDel ,b.ispublish as proPublic,b.DELETE_flag as ProDel from  RAYS02.TRAIN_COURSE_DIS a 
	LEFT JOIN  RAYS02.TRAIN_PROJECT b on a.PROJECT_ID =b.ID) b
	on a.TRAIN_COURSE_DIS_ID = b.couId
	where couPublic = #{checkState} and couDel=#{DEL_FLAG_NORMAL} 
	and proPublic =#{checkState} and ProDel = #{DEL_FLAG_NORMAL} 
	<if test="gradeId !=null and gradeId !='' and gradeId !='-1' ">
		and a.GRADE_ID  =#{gradeId}
	</if>
	<if test="kemuId !=null and kemuId!='' and   kemuId!='-1'">
		and a.DISCIPLINE_ID = #{kemuId}
	</if>
	<if test ="specialId !=null and specialId!='' and specialId!='-1' ">
		and a.SPECIAL_ID = #{specialId}
	</if>
	<if test = "orangerId!=null and orangerId!=''">
	  and a.TRAIN_COURSE_DIS_ID in (
	   select course_id from RAYS02.TRAIN_COURSE_DIS_ORGANIGER where organiger_id in
	   (SELECT manage_user_id from RAYS02.CMS_FAMOUSTEA  where id= #{orangerId} and del_flag=#{DEL_FLAG_NORMAL} ) 
	  )
	</if>
	order by currId desc
	</select>
	
	<select id="getZskTea" resultType="java.util.Map">
		select a.id, 
			b.username ,
			b.schoolName
		from RAYS02.TRAIN_COURSE_DIS_ORGANIGER a 
			LEFT JOIN  (select a.id, a.username,b.name as schoolName from  RAYS02.MANAGE_USER a 
		LEFT JOIN RAYS02.manage_school b on a.school = b.id) b 
		on a.organiger_id = b.id
		where a.course_id = #{currId}
		order by id 
	</select>
	
	<select id="getZskPic" resultType="java.util.Map">
		SELECT id,
			course_id ,
			A.large_path,
			name,
			uploader_id
		FROM RAYS02.TRAIN_PHOTO A
		WHERE A.DELETE_FLAG = '0'
		AND a.COURSE_TYPE = '1'
		AND COURSE_ID = #{currId}
		order by id
	</select>
	<resultMap id="zskResultMap" type="com.gcit.logincms.modules.teachtraining.entity.RetrainCurriculum">
		<result property="currId" column="currId"></result>
		<result property="currName" column="currName"></result>
		<result property="hitNum" column="hitNum"></result>
		<collection property="orgNameList" javaType="ArrayList" column="currId" 
		ofType="java.util.Map" select="getZskTea">
		</collection>
		<collection property="picList" javaType="ArrayList" column="{currId=currId}"
		ofType="java.util.Map" select = "getZskPic">
		</collection>
	</resultMap>

\\\\\\\\\\\\\\\\\\\\\\\*********************\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

MYABTIS 批量插入与删除

© 著作权归作者所有

上班不要玩手机
粉丝 2
博文 63
码字总数 10125
作品 0
苏州
程序员
私信 提问
ZHENFENGSHISAN/perfect-ssm

Quick Start 项目简介 ssm系列 ssm-demo:Spring+SpringMVC+Mybatis+easyUI整合 perfect-ssm:RESTful API+redis缓存 ssm-cluster:前后端分离+集群部署 ssm-dubbo:dubbo服务化 ssm-micro-se......

ZHENFENGSHISAN
2017/09/18
0
0
SpringCloud Eureka 源码解析 —— 应用实例注册发现(六)之全量获取

SpringCloud Eureka 源码解析 —— 应用实例注册发现(六)之全量获取 Harries Blog™2017-12-311 阅读 ACESpringAppcacheAPIbuildAtombug 摘要: 原创出处 http ://www. ioc oder.cn/ Eureka...

Harries Blog™
2017/12/31
0
0
SSM+maven项目,tomcat启动报错,求解

log4j:WARN No appenders could be found for logger (com.alibaba.druid.pool.DruidDataSource).16:02:31.322 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retu......

雅尔格里斯
2017/06/13
1K
3
网关 Spring-Cloud-Gateway 源码解析 —— 网关初始化

网关 Spring-Cloud-Gateway 源码解析 —— 网关初始化 Harries Blog™2017-12-135 阅读 SpringAppclasspathcatbeanAPIbuildbug 本文主要基于 Spring-Cloud-Gateway 2.0.X M4 摘要: 原创出处 ......

Harries Blog™
2017/12/13
0
0
我竟然加了这么多班!程序员最新防骗指南:你还在傻傻加班吗?

最近因为个人原因离职,换了份工作,在和上一家公司结算工资的时候出了些bug,我个人感觉我平时加班还是比较多。每周加班最少四天,有时候甚至6天。我今年也是刚毕业来北京,虽说之前在学校有...

我是一个程序猿
2017/12/08
0
0

没有更多内容

加载失败,请刷新页面

加载更多

设计模式之访问者模式

定义 Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which......

陈年之后是青葱
昨天
9
0
PhotoShop 高级应用 : 分层云彩 - 简单闪电效果

1.创建黑白渐水平渐变图层 2.选择滤镜选项卡: 渲染--->分层云彩功能 3.将滤镜-云彩效果渲染后的图层进行反相操作 【此时出现闪电效果】 6.调整色阶,使得闪电效果更明显 7.创建剪贴蒙版:色...

东方墨天
昨天
9
0
三种实现Android主界面Tab的方式

三种实现Android主界面Tab的方式 https://www.cnblogs.com/caobotao/p/5103673.html

shzwork
昨天
9
0
java8-Optional类

背景 NPE问题,100%的Java程序员都碰到,并且曾经是心中的痛。 1965年英国TonyHoare引入了Null引用,后续的设计语言包括Java都保持了这种设计。 一个例子 业务模型 Person 有车一族, 有Car...

春天springcarter
昨天
11
0
py 登录github时token以及cookie的应用

import requestsfrom bs4 import BeautifulSoup## 获取tokenr1 = requests.get('https://github.com/login')s1 = BeautifulSoup(r1.text,'html.parser')token = s1.find(name='input',......

子枫Eric
昨天
8
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部