src/main/java/cn/pzhu/pserson/dao/provider/NoticeDynaSqlProvider.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package cn.pzhu.pserson.dao.provider;

import static cn.pzhu.pserson.util.Constants.NOTICETABLE;

import cn.pzhu.pserson.domain.Notice;
import org.apache.ibatis.jdbc.SQL;

public class NoticeDynaSqlProvider {
			// 动态插入
			public String insert_Notice(Notice notice){
				
				return new SQL(){
					{
						INSERT_INTO(NOTICETABLE);
						if(notice.getTitle() != null ){
							VALUES("title", "#{title}");
						}
						if(notice.getUserId()!=null){
							VALUES("user_id","#{user_id}");
						}
						if(notice.getContent()!=null){
							VALUES("content","#{content}");
						}
						if(notice.getCreateDate()!=null){
							VALUES("createDate","#{createDate}");
						}
						if(notice.getSrc()!=null){
							VALUES("src","#{src}");
						}
						if(notice.getNeedCount()!=null){
							VALUES("need_count","#{needCount}");
						}
						if(notice.getHaveCount()!=null){
							VALUES("have_count","#{haveCount}");
						}
						if(notice.getSaveCount()!=null){
							VALUES("save_count","#{saveCount}");
						}
						if(notice.getUnit()!=null){
							VALUES("unit","#{unit}");
						}
						if(notice.getPeopleCount()!=null){
							VALUES("people_count","#{peopleCount}");
						}
					}
				}.toString();
			}	
			// 动态更新
			public String update_Notice(Notice notice){
				
				return new SQL(){
					{
						UPDATE(NOTICETABLE);
						if(notice.getTitle() != null ){
							SET("title = #{title}");
						}
						if(notice.getUserId()!=null){
							SET("user_id = #{user_id}");
						}
						if(notice.getContent()!=null){
后面还有 28 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。