|
|
|
@ -3,9 +3,19 @@ |
|
|
|
<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函数区域--> |
|
|
|
@ -14,20 +24,10 @@ |
|
|
|
|
|
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select res.* from xm_env_list res |
|
|
|
|
|
|
|
select * from xm_env_list res |
|
|
|
<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"/> |
|
|
|
<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> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -45,7 +45,13 @@ |
|
|
|
where |
|
|
|
res.id = #{id} |
|
|
|
</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--> |
|
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select * from xm_env_list res |
|
|
|
@ -54,7 +60,7 @@ |
|
|
|
</select> |
|
|
|
<!-- 获取数据条目 返回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> |
|
|
|
<include refid="where"/> |
|
|
|
</where> |
|
|
|
@ -64,7 +70,7 @@ |
|
|
|
insert into xm_env_list( |
|
|
|
<include refid="columns"/> |
|
|
|
) 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> |
|
|
|
|
|
|
|
@ -114,19 +120,32 @@ |
|
|
|
where id = #{item.id} |
|
|
|
</foreach> |
|
|
|
</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 from xm_env_list |
|
|
|
where id in |
|
|
|
where |
|
|
|
(id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
#{item.id } |
|
|
|
( #{item.id} ) |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
|
<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片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
|
@ -146,12 +165,14 @@ |
|
|
|
<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="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="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="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 id="set"> |
|
|
|
@ -174,7 +195,9 @@ |
|
|
|
start_time = #{startTime}, |
|
|
|
end_time = #{endTime}, |
|
|
|
fee_amount = #{feeAmount}, |
|
|
|
fee_rule = #{feeRule} |
|
|
|
fee_rule = #{feeRule}, |
|
|
|
biz_proc_inst_id = #{bizProcInstId}, |
|
|
|
biz_flow_state = #{bizFlowState} |
|
|
|
</sql> |
|
|
|
<sql id="someFieldSet"> |
|
|
|
<if test="remark != null and remark != ''"> remark = #{remark}, </if> |
|
|
|
@ -197,6 +220,8 @@ |
|
|
|
<if test="endTime != null"> end_time = #{endTime}, </if> |
|
|
|
<if test="feeAmount != null and feeAmount != ''"> fee_amount = #{feeAmount}, </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 id="batchSet"> |
|
|
|
@ -219,6 +244,8 @@ |
|
|
|
start_time = #{item.startTime}, |
|
|
|
end_time = #{item.endTime}, |
|
|
|
fee_amount = #{item.feeAmount}, |
|
|
|
fee_rule = #{item.feeRule} |
|
|
|
fee_rule = #{item.feeRule}, |
|
|
|
biz_proc_inst_id = #{item.bizProcInstId}, |
|
|
|
biz_flow_state = #{item.bizFlowState} |
|
|
|
</sql> |
|
|
|
</mapper> |