Mybatis的mapper示例





	
	
		xsm.id,
		xsm.sender,
		xsm.custom,
		xsm.images,
		xsm.status,
		xsm.createtime,
		xsm.mail_type,
		xsm.approval_type,
		xsm.title,
		xsm.main_content,
		xsm.secont_content,
		xsm.updatetime
	

	
	
		
		
		
		
		
		
		
		
		
		
		
		
	


	
	
		where 1=1
		
			
				and id = #{ID}
			
			
				and sender = #{sender}
			
			
				and custom = #{custom}
			
			
				and status = #{status}
			
			
				and mail_type = #{mailType}
			
			
				and approval_type = #{approvalType}
			
			
				and title LIKE CONCAT('%',#{title},'%')
			
			
				and main_content LIKE CONCAT('%',#{mainContent},'%')
			
			
				and secont_content LIKE CONCAT('%',#{secontContent},'%')
			
			
				and images = #{images}
			
		
		ORDER BY xsm.`status`,xsm.updatetime DESC
	

	
		insert into
		xazq_system_mail
		(sender,
		custom,
		title,
		main_content,
		secont_content,
		images,
		createtime,
		updatetime,
		status,
		mail_type,
		approval_type
		)
		values
		(#{sender,
		jdbcType=BIGINT},
		#{custom, jdbcType=BIGINT},
		#{title,
		jdbcType=VARCHAR},
		#{mainContent, jdbcType=VARCHAR},
		#{secontContent,
		jdbcType=VARCHAR},
		#{images, jdbcType=VARCHAR},
		#{createtime,
		jdbcType=VARCHAR},
		#{updatetime, jdbcType=VARCHAR},
		#{status,
		jdbcType=VARCHAR},
		#{mailType, jdbcType=VARCHAR},
		#{approvalType,
		jdbcType=VARCHAR})
	


	
		INSERT INTO
		xazq_system_mail
		(sender,
		custom,
		title,
		main_content,
		secont_content,
		images,
		createtime,
		updatetime,
		status,
		mail_type,
		approval_type
		)
		VALUES
		
			(#{mail.sender},
			#{mail.custom},
			#{mail.title},
			#{mail.mainContent},
			#{mail.secontContent},
			#{mail.images},
			#{mail.createtime},
			#{mail.updatetime},
			#{mail.status},
			#{mail.mailType},
			#{mail.approvalType})
		
	

	
	


	



	
		update xazq_system_mail
		
			
				
					
						when id=#{i.id} then #{i.standardFromUuid}
					
				
			
			
				
					
						when id=#{i.id} then #{i.standardToUuid}
					
				
			
			
				
					
						when id=#{i.id} then #{i.gmtModified}
					
				
			
		
		where
		
			id=#{i.id}
		
	

	
	
		UPDATE xazq_system_mail
		SET STATUS = 1
		WHERE
		STATUS = 0
		AND CUSTOM = #{custom}
		AND id IN
		
			#{id}
		
	

	
	
		UPDATE xazq_system_mail
		SET STATUS = 1
		WHERE
		STATUS = 0
		AND CUSTOM = #{custom}
	


	
	
		UPDATE xazq_system_mail
		SET approval_type =
		#{approvalType}
		WHERE
		id = #{id} AND mail_type = 2
	

	
	

	

	

 

你可能感兴趣的:(mybatis)