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

(开头部分) 2KB

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

package cn.pzhu.pserson.dao.provider;


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

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

public class GiveDynaSqlProvider {
			// 动态插入
			public String insert_GiveInfo(Give give){
				
				return new SQL(){
					{
						INSERT_INTO(GIVETABLE);
						if(give.getProductId() != null ){
							VALUES("product_id", "#{productId}");
						}
						if(give.getGiveName()!=null){
							VALUES("give_name","#{giveName}");
						}
						if(give.getGivePhone()!=null){
							VALUES("give_phone","#{givePhone}");
						}
						if(give.getGiveAddress()!=null){
							VALUES("give_address","#{giveAddress}");
						}
						if(give.getProductCount()!=null){
							VALUES("product_count","#{productCount}");
						}
						if(give.getUnit()!=null){
							VALUES("unit","#{unit}");
						}
						if(give.getLogisticId()!=null){
							VALUES("logistic_id","#{logisticId}");
						}
						if(give.getCreatedate()!=null){
							VALUES("createdate","#{createdate}");
						}
						if(give.getUserId()!=null){
							VALUES("user_id","#{userId}");
						}
					}
				}.toString();
			}	
			// 动态更新
			public String update_GiveInfo(Give give){
				
				return new SQL(){
					{
						UPDATE(GIVETABLE);
						if(give.getProductId() != null ){
							SET("product_id = #{productId}");
						}
						if(give.getGiveName()!=null){
							SET("give_name = #{giveName}");
						}
						if(give.getGivePhone()!=null){
							SET("give_phone = #{givePhone}");
						}
后面还有 23 行代码,购买后查看完整代码

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

AI 解读 AI

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

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