Browse Source

优化迭代

master
陈裕财 4 years ago
parent
commit
7076bc611b
  1. 279
      xm-core/src/main/java/com/xm/core/entity/XmEnvList.java
  2. 141
      xm-core/src/main/java/com/xm/core/entity/XmFile.java
  3. 83
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmEnvListMapper.xml
  4. 57
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmFileMapper.xml

279
xm-core/src/main/java/com/xm/core/entity/XmEnvList.java

@ -1,21 +1,20 @@
package com.xm.core.entity;
package com.xm.core.entity;
import lombok.Data;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal;
/** /**
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br>
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmEnvList所有属性名: <br> * 实体 XmEnvList所有属性名: <br>
* id,remark,ipAddress,port,branchId,accessUserid,accessPassword,effect,accessUrl,supplier,webIpAddress,webPort,otherRemark,createUserid,createUsername,createTime,envState,startTime,endTime,feeAmount,feeRule;<br>
* XM.xm_env_list xm_env_list的所有字段名: <br>
* id,remark,ip_address,port,branch_id,access_userid,access_password,effect,access_url,supplier,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,env_state,start_time,end_time,fee_amount,fee_rule;<br>
* "id","主键","remark","备注说明","ipAddress","内网ip地址","port","内网访问端口","branchId","归属机构","accessUserid","访问用户编号","accessPassword","访问密码","effect","作用说明","accessUrl","访问链接","supplier","供应商","webIpAddress","外网ip地址","webPort","外网端口","otherRemark","其它说明","createUserid","添加人员","createUsername","添加人员姓名","createTime","添加时间","envState","状态0不可用1已启用2已过期","startTime","有效日期开始","endTime","有效日期结束","feeAmount","费用","feeRule","计费规则","bizProcInstId","当前流程实例编号","bizFlowState","当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除";<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ApiModel(description="xm_env_list")
@Data
@ApiModel(description="项目环境清单")
public class XmEnvList implements java.io.Serializable { public class XmEnvList implements java.io.Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -84,267 +83,23 @@ public class XmEnvList implements java.io.Serializable {
@ApiModelProperty(notes="计费规则",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="计费规则",allowEmptyValue=true,example="",allowableValues="")
String feeRule; String feeRule;
/**主键**/
public XmEnvList(String id) {
this.id = id;
}
@ApiModelProperty(notes="当前流程实例编号",allowEmptyValue=true,example="",allowableValues="")
String bizProcInstId;
/**xm_env_list**/
public XmEnvList() {
}
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState;
/** /**
* 主键
*主键
**/ **/
public void setId(String id) {
public XmEnvList(String id) {
this.id = id; this.id = id;
} }
/**
* 备注说明
**/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 内网ip地址
**/
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
/**
* 内网访问端口
**/
public void setPort(String port) {
this.port = port;
}
/**
* 归属机构
**/
public void setBranchId(String branchId) {
this.branchId = branchId;
}
/**
* 访问用户编号
**/
public void setAccessUserid(String accessUserid) {
this.accessUserid = accessUserid;
}
/**
* 访问密码
**/
public void setAccessPassword(String accessPassword) {
this.accessPassword = accessPassword;
}
/**
* 作用说明
**/
public void setEffect(String effect) {
this.effect = effect;
}
/**
* 访问链接
**/
public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}
/**
* 供应商
**/
public void setSupplier(String supplier) {
this.supplier = supplier;
}
/**
* 外网ip地址
**/
public void setWebIpAddress(String webIpAddress) {
this.webIpAddress = webIpAddress;
}
/**
* 外网端口
**/
public void setWebPort(String webPort) {
this.webPort = webPort;
}
/**
* 其它说明
**/
public void setOtherRemark(String otherRemark) {
this.otherRemark = otherRemark;
}
/**
* 添加人员
**/
public void setCreateUserid(String createUserid) {
this.createUserid = createUserid;
}
/**
* 添加人员姓名
**/
public void setCreateUsername(String createUsername) {
this.createUsername = createUsername;
}
/**
* 添加时间
**/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 状态0不可用1已启用2已过期
**/
public void setEnvState(String envState) {
this.envState = envState;
}
/**
* 有效日期开始
**/
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
/**
* 有效日期结束
**/
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
/**
* 费用
**/
public void setFeeAmount(BigDecimal feeAmount) {
this.feeAmount = feeAmount;
}
/**
* 计费规则
**/
public void setFeeRule(String feeRule) {
this.feeRule = feeRule;
}
/**
* 主键
**/
public String getId() {
return this.id;
}
/**
* 备注说明
**/
public String getRemark() {
return this.remark;
}
/**
* 内网ip地址
**/
public String getIpAddress() {
return this.ipAddress;
}
/**
* 内网访问端口
**/
public String getPort() {
return this.port;
}
/**
* 归属机构
**/
public String getBranchId() {
return this.branchId;
}
/**
* 访问用户编号
**/
public String getAccessUserid() {
return this.accessUserid;
}
/**
* 访问密码
**/
public String getAccessPassword() {
return this.accessPassword;
}
/**
* 作用说明
**/
public String getEffect() {
return this.effect;
}
/**
* 访问链接
**/
public String getAccessUrl() {
return this.accessUrl;
}
/**
* 供应商
**/
public String getSupplier() {
return this.supplier;
}
/**
* 外网ip地址
**/
public String getWebIpAddress() {
return this.webIpAddress;
}
/**
* 外网端口
**/
public String getWebPort() {
return this.webPort;
}
/**
* 其它说明
**/
public String getOtherRemark() {
return this.otherRemark;
}
/**
* 添加人员
**/
public String getCreateUserid() {
return this.createUserid;
}
/**
* 添加人员姓名
**/
public String getCreateUsername() {
return this.createUsername;
}
/**
* 添加时间
**/
public Date getCreateTime() {
return this.createTime;
}
/**
* 状态0不可用1已启用2已过期
**/
public String getEnvState() {
return this.envState;
}
/**
* 有效日期开始
**/
public Date getStartTime() {
return this.startTime;
}
/**
* 有效日期结束
**/
public Date getEndTime() {
return this.endTime;
}
/**
* 费用
**/
public BigDecimal getFeeAmount() {
return this.feeAmount;
}
/**
* 计费规则
**/
public String getFeeRule() {
return this.feeRule;
/**
* 项目环境清单
**/
public XmEnvList() {
} }
} }

141
xm-core/src/main/java/com/xm/core/entity/XmFile.java

@ -1,19 +1,18 @@
package com.xm.core.entity;
package com.xm.core.entity;
import lombok.Data;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date; import java.util.Date;
/** /**
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br>
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmFile所有属性名: <br> * 实体 XmFile所有属性名: <br>
* id,name,projectId,projectName,description,createUserid,createUsername,createTime,bizProcInstId,bizFlowState;<br>
* XM.xm_file xm_file的所有字段名: <br>
* id,name,project_id,project_name,description,create_userid,create_username,create_time,biz_proc_inst_id,biz_flow_state;<br>
* "id","文档编号","name","文件名称","projectId","项目编号","projectName","项目名称","description","文件说明","createUserid","创建人编号","createUsername","创建人","createTime","创建时间","bizProcInstId","当前流程实例编号","bizFlowState","当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除";<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@Data
@ApiModel(description="xm_file") @ApiModel(description="xm_file")
public class XmFile implements java.io.Serializable { public class XmFile implements java.io.Serializable {
@ -50,135 +49,17 @@ public class XmFile implements java.io.Serializable {
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState; String bizFlowState;
/**文档编号**/
public XmFile(String id) {
this.id = id;
}
/**xm_file**/
public XmFile() {
}
/** /**
* 文档编号
*文档编号
**/ **/
public void setId(String id) {
public XmFile(String id) {
this.id = id; this.id = id;
} }
/**
* 文件名称
**/
public void setName(String name) {
this.name = name;
}
/**
* 项目编号
**/
public void setProjectId(String projectId) {
this.projectId = projectId;
}
/**
* 项目名称
**/
public void setProjectName(String projectName) {
this.projectName = projectName;
}
/**
* 文件说明
**/
public void setDescription(String description) {
this.description = description;
}
/**
* 创建人编号
**/
public void setCreateUserid(String createUserid) {
this.createUserid = createUserid;
}
/**
* 创建人
**/
public void setCreateUsername(String createUsername) {
this.createUsername = createUsername;
}
/**
* 创建时间
**/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 当前流程实例编号
**/
public void setBizProcInstId(String bizProcInstId) {
this.bizProcInstId = bizProcInstId;
}
/**
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除
**/
public void setBizFlowState(String bizFlowState) {
this.bizFlowState = bizFlowState;
}
/**
* 文档编号
**/
public String getId() {
return this.id;
}
/**
* 文件名称
**/
public String getName() {
return this.name;
}
/**
* 项目编号
**/
public String getProjectId() {
return this.projectId;
}
/**
* 项目名称
**/
public String getProjectName() {
return this.projectName;
}
/**
* 文件说明
**/
public String getDescription() {
return this.description;
}
/**
* 创建人编号
**/
public String getCreateUserid() {
return this.createUserid;
}
/**
* 创建人
**/
public String getCreateUsername() {
return this.createUsername;
}
/**
* 创建时间
**/
public Date getCreateTime() {
return this.createTime;
}
/**
* 当前流程实例编号
**/
public String getBizProcInstId() {
return this.bizProcInstId;
}
/**
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除
**/
public String getBizFlowState() {
return this.bizFlowState;
/**
* xm_file
**/
public XmFile() {
} }
} }

83
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmEnvListMapper.xml

@ -3,9 +3,19 @@
<mapper namespace="com.xm.core.entity.XmEnvList"> <mapper namespace="com.xm.core.entity.XmEnvList">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" ids != null"> and (res.id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<if test="key != null and key !='' "> </if>
<if test="fuzzy != null and fuzzy != ''">
and (res.ip_address like #{fuzzy} or res.web_ip_address like #{fuzzy} or res.access_url like #{fuzzy})
</if>
</sql>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->
@ -14,20 +24,10 @@
<!-- 通过条件查询获取数据列表 返回list<map> --> <!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> <select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select res.* from xm_env_list res
select * from xm_env_list res
<where> <where>
<if test="ids != null"> and
id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<include refid="whereForMap"/>
<include refid="where"/> <include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="fuzzy != null and fuzzy != ''">
and (res.ip_address like #{fuzzy} or res.web_ip_address like #{fuzzy} or res.access_url like #{fuzzy})
</if>
</where> </where>
</select> </select>
@ -45,7 +45,13 @@
where where
res.id = #{id} res.id = #{id}
</select> </select>
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmEnvList">
select * from xm_env_list res
where (res.id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</select>
<!-- 通过主键查询获取数据对象 返回map--> <!-- 通过主键查询获取数据对象 返回map-->
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> <select id="selectOneMap" parameterType="HashMap" resultType="HashMap">
select * from xm_env_list res select * from xm_env_list res
@ -54,17 +60,17 @@
</select> </select>
<!-- 获取数据条目 返回long --> <!-- 获取数据条目 返回long -->
<select id="countByWhere" parameterType="com.xm.core.entity.XmEnvList" resultType="long"> <select id="countByWhere" parameterType="com.xm.core.entity.XmEnvList" resultType="long">
select count(1) from xm_env_list res
select count(*) from xm_env_list res
<where> <where>
<include refid="where"/> <include refid="where"/>
</where> </where>
</select> </select>
<!-- 新增一条记录 主键id,--> <!-- 新增一条记录 主键id,-->
<insert id="insert" parameterType="com.xm.core.entity.XmEnvList" useGeneratedKeys="false" keyProperty="id">
<insert id="insert" parameterType="com.xm.core.entity.XmEnvList" useGeneratedKeys="false" keyProperty="id">
insert into xm_env_list( insert into xm_env_list(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{remark},#{ipAddress},#{port},#{branchId},#{accessUserid},#{accessPassword},#{effect},#{accessUrl},#{supplier},#{webIpAddress},#{webPort},#{otherRemark},#{createUserid},#{createUsername},#{createTime},#{envState},#{startTime},#{endTime},#{feeAmount},#{feeRule}
#{id},#{remark},#{ipAddress},#{port},#{branchId},#{accessUserid},#{accessPassword},#{effect},#{accessUrl},#{supplier},#{webIpAddress},#{webPort},#{otherRemark},#{createUserid},#{createUsername},#{createTime},#{envState},#{startTime},#{endTime},#{feeAmount},#{feeRule},#{bizProcInstId},#{bizFlowState}
) )
</insert> </insert>
@ -114,19 +120,32 @@
where id = #{item.id} where id = #{item.id}
</foreach> </foreach>
</update> </update>
<!-- 批量修改某几个字段 -->
<delete id="editSomeFields" parameterType="HashMap">
update xm_env_list
<set>
<include refid="someFieldSet"/>
</set>
where (id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</delete>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_env_list delete from xm_env_list
where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
#{item.id }
</foreach>
where
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id} )
</foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,remark,ip_address,port,branch_id,access_userid,access_password,effect,access_url,supplier,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,env_state,start_time,end_time,fee_amount,fee_rule
id,remark,ip_address,port,branch_id,access_userid,access_password,effect,access_url,supplier,web_ip_address,web_port,other_remark,create_userid,create_username,create_time,env_state,start_time,end_time,fee_amount,fee_rule,biz_proc_inst_id,biz_flow_state
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -146,12 +165,14 @@
<if test="otherRemark != null and otherRemark != ''"> and res.other_remark = #{otherRemark} </if> <if test="otherRemark != null and otherRemark != ''"> and res.other_remark = #{otherRemark} </if>
<if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if> <if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if>
<if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if> <if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if>
<if test="createTime != null"> and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') </if>
<if test="createTime != null"> and date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </if>
<if test="envState != null and envState != ''"> and res.env_state = #{envState} </if> <if test="envState != null and envState != ''"> and res.env_state = #{envState} </if>
<if test="startTime != null"> and TO_CHAR(res.start_time,'YYYY-MM-DD') = TO_CHAR(#{startTime},'YYYY-MM-DD') </if>
<if test="endTime != null"> and TO_CHAR(res.end_time,'YYYY-MM-DD') = TO_CHAR(#{endTime},'YYYY-MM-DD') </if>
<if test="startTime != null"> and date_format(res.start_time,'%Y-%m-%d') = date_format(#{startTime},'%Y-%m-%d') </if>
<if test="endTime != null"> and date_format(res.end_time,'%Y-%m-%d') = date_format(#{endTime},'%Y-%m-%d') </if>
<if test="feeAmount != null and feeAmount != ''"> and res.fee_amount = #{feeAmount} </if> <if test="feeAmount != null and feeAmount != ''"> and res.fee_amount = #{feeAmount} </if>
<if test="feeRule != null and feeRule != ''"> and res.fee_rule = #{feeRule} </if> <if test="feeRule != null and feeRule != ''"> and res.fee_rule = #{feeRule} </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if>
<if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -174,7 +195,9 @@
start_time = #{startTime}, start_time = #{startTime},
end_time = #{endTime}, end_time = #{endTime},
fee_amount = #{feeAmount}, fee_amount = #{feeAmount},
fee_rule = #{feeRule}
fee_rule = #{feeRule},
biz_proc_inst_id = #{bizProcInstId},
biz_flow_state = #{bizFlowState}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="remark != null and remark != ''"> remark = #{remark}, </if> <if test="remark != null and remark != ''"> remark = #{remark}, </if>
@ -197,6 +220,8 @@
<if test="endTime != null"> end_time = #{endTime}, </if> <if test="endTime != null"> end_time = #{endTime}, </if>
<if test="feeAmount != null and feeAmount != ''"> fee_amount = #{feeAmount}, </if> <if test="feeAmount != null and feeAmount != ''"> fee_amount = #{feeAmount}, </if>
<if test="feeRule != null and feeRule != ''"> fee_rule = #{feeRule}, </if> <if test="feeRule != null and feeRule != ''"> fee_rule = #{feeRule}, </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> biz_proc_inst_id = #{bizProcInstId}, </if>
<if test="bizFlowState != null and bizFlowState != ''"> biz_flow_state = #{bizFlowState}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -219,6 +244,8 @@
start_time = #{item.startTime}, start_time = #{item.startTime},
end_time = #{item.endTime}, end_time = #{item.endTime},
fee_amount = #{item.feeAmount}, fee_amount = #{item.feeAmount},
fee_rule = #{item.feeRule}
fee_rule = #{item.feeRule},
biz_proc_inst_id = #{item.bizProcInstId},
biz_flow_state = #{item.bizFlowState}
</sql> </sql>
</mapper> </mapper>

57
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmFileMapper.xml

@ -3,8 +3,16 @@
<mapper namespace="com.xm.core.entity.XmFile"> <mapper namespace="com.xm.core.entity.XmFile">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" ids != null"> and (res.id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<if test="key != null and key !='' "> </if>
</sql>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->
@ -13,16 +21,10 @@
<!-- 通过条件查询获取数据列表 返回list<map> --> <!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> <select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select res.* from xm_file res
select * from xm_file res
<where> <where>
<if test="ids != null"> and
id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<include refid="whereForMap"/>
<include refid="where"/> <include refid="where"/>
<if test="key != null and key !='' "> </if>
</where> </where>
</select> </select>
@ -40,7 +42,13 @@
where where
res.id = #{id} res.id = #{id}
</select> </select>
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmFile">
select * from xm_file res
where (res.id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</select>
<!-- 通过主键查询获取数据对象 返回map--> <!-- 通过主键查询获取数据对象 返回map-->
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> <select id="selectOneMap" parameterType="HashMap" resultType="HashMap">
select * from xm_file res select * from xm_file res
@ -49,13 +57,13 @@
</select> </select>
<!-- 获取数据条目 返回long --> <!-- 获取数据条目 返回long -->
<select id="countByWhere" parameterType="com.xm.core.entity.XmFile" resultType="long"> <select id="countByWhere" parameterType="com.xm.core.entity.XmFile" resultType="long">
select count(1) from xm_file res
select count(*) from xm_file res
<where> <where>
<include refid="where"/> <include refid="where"/>
</where> </where>
</select> </select>
<!-- 新增一条记录 主键id,--> <!-- 新增一条记录 主键id,-->
<insert id="insert" parameterType="com.xm.core.entity.XmFile" useGeneratedKeys="false" keyProperty="id">
<insert id="insert" parameterType="com.xm.core.entity.XmFile" useGeneratedKeys="false" keyProperty="id">
insert into xm_file( insert into xm_file(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
@ -109,13 +117,26 @@
where id = #{item.id} where id = #{item.id}
</foreach> </foreach>
</update> </update>
<!-- 批量修改某几个字段 -->
<delete id="editSomeFields" parameterType="HashMap">
update xm_file
<set>
<include refid="someFieldSet"/>
</set>
where (id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</delete>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_file delete from xm_file
where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
#{item.id }
</foreach>
where
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id} )
</foreach>
</delete> </delete>
@ -133,7 +154,7 @@
<if test="description != null and description != ''"> and res.description = #{description} </if> <if test="description != null and description != ''"> and res.description = #{description} </if>
<if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if> <if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if>
<if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if> <if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if>
<if test="createTime != null"> and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') </if>
<if test="createTime != null"> and date_format(res.create_time,'%Y-%m-%d') = date_format(#{createTime},'%Y-%m-%d') </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if> <if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if>
<if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if> <if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if>
</sql> </sql>

Loading…
Cancel
Save