feat: There is no way the Laws
This commit is contained in:
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
|
||||
<id column="id" property="id" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="use_model" property="useModule" />
|
||||
<result column="att_id" property="attId" />
|
||||
<result column="ori_att_id" property="oriAttId" />
|
||||
<result column="laws_id" property="lawsId" />
|
||||
<result column="file_suffix" property="fileSuffix" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="laws_file_classify" property="lawsFileClassify" />
|
||||
<result column="password" property="password" />
|
||||
<result column="creation_user" property="creationUser" />
|
||||
<result column="resId" property="resId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- SAR_LAWS_FILE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, use_model, att_id, laws_id, id,file_suffix,file_name,laws_file_classify,
|
||||
password,creation_user,ori_att_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="modifyTime != null" >
|
||||
and modify_time ${modifyTimeOperator} #{modifyTime}
|
||||
</if>
|
||||
<if test="modifyTime1 != null" >
|
||||
and modify_time >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null" >
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
and creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null" >
|
||||
and creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null" >
|
||||
and creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="useModule != null" >
|
||||
and use_model ${useModuleOperator} #{useModule}
|
||||
</if>
|
||||
<if test="attId != null" >
|
||||
and att_id ${attIdOperator} #{attId}
|
||||
</if>
|
||||
<if test="resId != null" >
|
||||
and res_id ${resIdOperator} #{resId}
|
||||
</if>
|
||||
<if test="lawsId != null" >
|
||||
and laws_id ${lawsIdOperator} #{lawsId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
|
||||
insert into SAR_LAWS_FILE
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="modifyTime != null" >modify_time,</if>
|
||||
<if test="creationTime != null" >creation_time,</if>
|
||||
<if test="validFlag != null" >valid_flag,</if>
|
||||
<if test="useModule != null" >use_model,</if>
|
||||
<if test="attId != null" >att_id,</if>
|
||||
<if test="lawsId != null" >laws_id,</if>
|
||||
<if test="id != null" >id,</if>
|
||||
<if test="fileSuffix != null" >file_suffix,</if>
|
||||
<if test="fileName != null" >file_name,</if>
|
||||
<if test="lawsFileClassify != null" >laws_file_classify,</if>
|
||||
<if test="password != null" >password,</if>
|
||||
<if test="creationUser != null" >creation_user,</if>
|
||||
<if test="oriAttId != null" >ori_att_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
|
||||
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
|
||||
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
|
||||
<if test="useModule != null" >#{useModule, jdbcType=VARCHAR},</if>
|
||||
<if test="attId != null" >#{attId, jdbcType=VARCHAR},</if>
|
||||
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
<if test="fileSuffix != null" >#{fileSuffix, jdbcType=VARCHAR},</if>
|
||||
<if test="fileName != null" >#{fileName, jdbcType=VARCHAR},</if>
|
||||
<if test="lawsFileClassify != null" >#{lawsFileClassify, jdbcType=VARCHAR},</if>
|
||||
<if test="password != null" >#{password, jdbcType=VARCHAR},</if>
|
||||
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
|
||||
<if test="oriAttId != null" >#{oriAttId, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
|
||||
update SAR_LAWS_FILE
|
||||
<set >
|
||||
<if test="oriAttId != null" >
|
||||
ori_att_id = #{oriAttId},
|
||||
</if>
|
||||
<if test="modifyTime != null" >
|
||||
modify_time = #{modifyTime},
|
||||
</if>
|
||||
<if test="creationTime != null" >
|
||||
creation_time = #{creationTime},
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
<if test="useModule != null" >
|
||||
use_model = #{useModule},
|
||||
</if>
|
||||
<if test="attId != null" >
|
||||
att_id = #{attId},
|
||||
</if>
|
||||
<if test="lawsId != null" >
|
||||
laws_id = #{lawsId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 SAR_LAWS_FILE -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where id = #{value} and valid_flag=0
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from SAR_LAWS_FILE
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- SAR_LAWS_FILE 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from SAR_LAWS_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询SAR_LAWS_FILE列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List" /> from
|
||||
(select tmp_tb.* from
|
||||
(select <include refid="Base_Column_List" /> from SAR_LAWS_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from SAR_LAWS_FILE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectFileBylawsId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where laws_id = #{value} and valid_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectFileBylawsIdAndId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where valid_flag = 0
|
||||
<if test="lawsId != null" >
|
||||
and laws_id = #{lawsId}
|
||||
</if>
|
||||
<if test="idList != null">
|
||||
and id not in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectFileByAttId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where valid_flag = 0
|
||||
and INSTR((
|
||||
select GROUP_CONCAT(laws_id)
|
||||
from SAR_LAWS_FILE
|
||||
where att_id = #{value} and valid_flag = 0 and use_model = 'SOURCE_FILE'),laws_id
|
||||
)
|
||||
and use_model = 'WEB_FILE'
|
||||
and ori_att_id = #{value}
|
||||
order by modify_time desc
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFileMsgByAttId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where valid_flag = 0
|
||||
and att_id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- gaoyan 根据resid 查询 -->
|
||||
<select id="selectFileByResId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_LAWS_FILE
|
||||
where use_model = 'SOURCE_FILE'
|
||||
<if test="resId != null" >
|
||||
and res_id = #{resId, jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="modifyTime != null" >
|
||||
and modify_time <= #{modifyTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteBylawsId" parameterType="java.lang.String">
|
||||
delete from SAR_LAWS_FILE
|
||||
where laws_id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<insert id="insertForeach" parameterType="java.util.List">
|
||||
insert into SAR_LAWS_FILE
|
||||
(<include refid="Base_Column_List" />)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.modifyTime, jdbcType=TIMESTAMP},
|
||||
#{item.creationTime, jdbcType=TIMESTAMP},
|
||||
#{item.validFlag, jdbcType=INTEGER},
|
||||
#{item.useModel, jdbcType=VARCHAR},
|
||||
#{item.attId, jdbcType=VARCHAR},
|
||||
#{item.lawsId, jdbcType=VARCHAR},
|
||||
#{item.id, jdbcType=VARCHAR},
|
||||
#{item.fileSuffix, jdbcType=VARCHAR},
|
||||
#{item.fileName, jdbcType=VARCHAR},
|
||||
#{item.lawsFileClassify, jdbcType=VARCHAR},
|
||||
#{item.password, jdbcType=VARCHAR},
|
||||
#{item.creationUser, jdbcType=VARCHAR},
|
||||
#{item.oriAttId, jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user