feat: There is no way the Laws

This commit is contained in:
super_liu
2021-10-28 18:10:31 +08:00
parent ac60a29630
commit 62c18594db
45 changed files with 3817 additions and 39 deletions
@@ -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 &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{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 &lt;= #{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>
@@ -0,0 +1,5 @@
<?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.sarLawsItemVal.dao.SarLawsItemValDao">
</mapper>
@@ -0,0 +1,196 @@
<?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.sarLawsMenu.dao.SarLawsMenuDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<id column="id" property="id" />
<result column="valid_flag" property="validFlag" />
<result column="menu_id" property="menuId" />
<result column="laws_id" property="lawsId" />
</resultMap>
<!-- SAR_LAWS_MENU table all fields -->
<sql id="Base_Column_List" >
valid_flag, menu_id, laws_id, id
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="menuId != null" >
and menu_id ${menuIdOperator} #{menuId}
</if>
<if test="lawsId != null" >
and laws_id ${lawsIdOperator} #{lawsId}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_LAWS_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_LAWS_MENU(<include refid="Base_Column_List" />)
values (#{validFlag, jdbcType=INTEGER}, #{menuId, jdbcType=VARCHAR}, #{lawsId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_LAWS_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_LAWS_MENU
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >valid_flag,</if>
<if test="menuId != null" >menu_id,</if>
<if test="lawsId != null" >laws_id,</if>
<if test="id != null" >id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="menuId != null" >#{menuId, jdbcType=VARCHAR},</if>
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_LAWS_MENU
set valid_flag = #{validFlag},
menu_id = #{menuId},
laws_id = #{lawsId}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_LAWS_MENU
<set >
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="menuId != null" >
menu_id = #{menuId},
</if>
<if test="lawsId != null" >
laws_id = #{lawsId},
</if>
</set>
where id = #{id}
</update>
<update id="updateMenuidByMenuid" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.NewmenuOldmenuVO" >
update SAR_LAWS_MENU
set menu_id = #{newMenuid}
where menu_id = #{oldMenuid}
</update>
<!-- 根据id查询 SAR_LAWS_MENU -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_LAWS_MENU
where id = #{value}
</delete>
<!-- SAR_LAWS_MENU 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_LAWS_MENU列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* , rownum rn from
(select <include refid="Base_Column_List" /> from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex})
where rn &gt;= ${pager.startIndex}
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<!-- 根据id查询 SAR_LAWS_MENU -->
<select id="selectByLawsInfo" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenuEOPage">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
</select>
<select id="selectByLawsId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where laws_id = #{value} and valid_flag=0
</select>
<delete id="deleteByLawsId" parameterType="java.lang.String">
delete from SAR_LAWS_MENU
where laws_id = #{value}
</delete>
<select id="selectMenuByMenuParentId" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_MENU
where laws_id = #{lawsId} and valid_flag=0
and MENU_ID in (select SAR_MENU.id from SAR_MENU where VALID_FLAG=0 start with id=#{menuId} connect by prior id= parent_id)
</select>
<update id="updateByLawsIdAndMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_BUSS_STAND_MENU
<set >
<if test="menuId != null" >
menu_id = #{menuId},
</if>
</set>
where laws_id = #{lawsId}
and MENU_ID in
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<delete id="deleteByMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
delete from SAR_LAWS_MENU
where laws_id = #{lawsId}
and MENU_ID in (select SAR_MENU.id from SAR_MENU
where VALID_FLAG=0 start with id=#{oldMenuId} connect by prior id= parent_id)
</delete>
<select id="selectAllMenuByStandId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where laws_id = #{lawsId} and valid_flag=0
</select>
<delete id="deleteByLawsIdAndMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
delete from SAR_LAWS_MENU
where laws_id = #{lawsId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
</delete>
</mapper>
@@ -0,0 +1,299 @@
<?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.sarLawsStandInfo.dao.SarLawsStandInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo" >
</resultMap>
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo" >
</resultMap>
<sql id="Base_Where_Clause">
where 1=1 and SAR_LAWS_STAND_INFO.valid_flag=0
<trim suffixOverrides="," >
<if test="id != null" >
and SAR_LAWS_STAND_INFO.id ${idOperator} #{id}
</if>
<!-- 基本搜索项 -->
<if test="lawsType != null and lawsType != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE like concat(concat('%',#{lawsType}),'%')
</if>
<if test="lawsNumber != null and lawsNumber != ''">
and SAR_LAWS_STAND_INFO.LAWS_NUMBER like concat(concat('%',#{lawsNumber}),'%')
</if>
<if test="lawsName != null and lawsName != ''">
and LAWS_NAME like concat(concat('%',#{lawsName}),'%')
</if>
<if test="lawsEnName != null and lawsEnName != ''">
and SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{lawsEnName}),'%')
</if>
<if test="lawsNo != null and lawsNo != ''">
and SAR_LAWS_STAND_INFO.LAWS_NO like concat(concat('%',#{lawsNo}),'%')
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.ISSUE_TIME,'%Y-%m-%d') = #{issueTime}
</if>
<if test="issueCompany != null and issueCompany != ''">
and SAR_LAWS_STAND_INFO.ISSUE_COMPANY like concat(concat('%',#{issueCompany}),'%')
</if>
<if test="commentCycleStart != null and commentCycleStart != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleStart},'%Y-%m-%d')
</if>
<if test="commentCycleEnd != null and commentCycleEnd != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleEnd},'%Y-%m-%d')
</if>
<if test="lawsTextState != null and lawsTextState != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE = #{lawsTextState}
</if>
<if test="lawsSyqy != null and lawsSyqy != ''">
and FIND_IN_SET(#{lawsSyqy},SAR_LAWS_STAND_INFO.LAWS_SYQY)
</if>
<if test="lawsSycx != null and lawsSycx != ''">
and FIND_IN_SET(#{lawsSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
</if>
<if test="isRelateAccess != null and isRelateAccess != ''">
and SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="lawsYear != null and lawsYear != ''">
and SAR_LAWS_STAND_INFO.LAWS_YEAR like concat(concat('%',#{lawsYear}),'%')
</if>
<if test="lawsNotisyncNum != null and lawsNotisyncNum != ''">
and SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM like concat(concat('%',#{lawsNotisyncNum}),'%')
</if>
<if test="lawsBulletin != null and lawsBulletin != ''">
and SAR_LAWS_STAND_INFO.LAWS_BULLETIN like concat(concat('%',#{lawsBulletin}),'%')
</if>
<if test="lawsLabel != null and lawsLabel != ''">
and SAR_LAWS_STAND_INFO.LAWS_LABEL like concat(concat('%',#{lawsLabel}),'%')
</if>
<if test="lawsRemark != null and lawsRemark != ''">
and SAR_LAWS_STAND_INFO.LAWS_REMARK like concat(concat('%',#{lawsRemark}),'%')
</if>
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and SAR_LAWS_STAND_INFO.country = #{country}
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left">
left join SAR_STAND_MENU ON SAR_LAWS_STAND_INFO.id = SAR_STAND_MENU.stand_id
where 1=1 and SAR_LAWS_STAND_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 基本搜索项 -->
<if test="lawsType != null and lawsType != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE like concat(concat('%',#{lawsType}),'%')
</if>
<if test="lawsNumber != null and lawsNumber != ''">
and SAR_LAWS_STAND_INFO.LAWS_NUMBER like concat(concat('%',#{lawsNumber}),'%')
</if>
<if test="numberName != null and numberName != ''">
and (LAWS_NAME like concat(concat('%',#{numberName}),'%')
or SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{numberName}),'%'))
</if>
<if test="lawsName != null and lawsName != ''">
and LAWS_NAME like concat(concat('%',#{lawsName}),'%')
</if>
<if test="lawsEnName != null and lawsEnName != ''">
and SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{lawsEnName}),'%')
</if>
<if test="lawsNo != null and lawsNo != ''">
and SAR_LAWS_STAND_INFO.LAWS_NO like concat(concat('%',#{lawsNo}),'%')
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.ISSUE_TIME,'%Y-%m-%d') = #{issueTime}
</if>
<if test="issueCompany != null and issueCompany != ''">
and SAR_LAWS_STAND_INFO.ISSUE_COMPANY like concat(concat('%',#{issueCompany}),'%')
</if>
<if test="commentCycleStart != null and commentCycleStart != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleStart},'%Y-%m-%d')
</if>
<if test="commentCycleEnd != null and commentCycleEnd != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleEnd},'%Y-%m-%d')
</if>
<if test="lawsTextState != null and lawsTextState != ''">
and SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE = #{lawsTextState}
</if>
<if test="lawsSyqy != null and lawsSyqy != ''">
and FIND_IN_SET(#{lawsSyqy},SAR_LAWS_STAND_INFO.LAWS_SYQY)
</if>
<if test="lawsSycx != null and lawsSycx != ''">
and FIND_IN_SET(#{lawsSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
</if>
<if test="isRelateAccess != null and isRelateAccess != ''">
and SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="lawsYear != null and lawsYear != ''">
and SAR_LAWS_STAND_INFO.LAWS_YEAR like concat(concat('%',#{lawsYear}),'%')
</if>
<if test="lawsNotisyncNum != null and lawsNotisyncNum != ''">
and SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM like concat(concat('%',#{lawsNotisyncNum}),'%')
</if>
<if test="lawsBulletin != null and lawsBulletin != ''">
and SAR_LAWS_STAND_INFO.LAWS_BULLETIN like concat(concat('%',#{lawsBulletin}),'%')
</if>
<if test="lawsLabel != null and lawsLabel != ''">
and SAR_LAWS_STAND_INFO.LAWS_LABEL like concat(concat('%',#{lawsLabel}),'%')
</if>
<if test="lawsRemark != null and lawsRemark != ''">
and SAR_LAWS_STAND_INFO.LAWS_REMARK like concat(concat('%',#{lawsRemark}),'%')
</if>
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and SAR_LAWS_STAND_INFO.country = #{country}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_LAWS_STAND_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_LAWS_STAND_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = a.LAWS_TEXT_STATE
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_LAWS_ATTR_INFO on (SAR_LAWS_ATTR_INFO.LAWS_ID = a.id and SAR_LAWS_ATTR_INFO.valid_flag=0)
where 1=1
<trim suffixOverrides=",">
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="Base_Column_List_Show" >
DISTINCT SAR_LAWS_STAND_INFO.ID,
SAR_LAWS_STAND_INFO.LAWS_TYPE,
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
SAR_LAWS_STAND_INFO.LAWS_NAME,
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
SAR_LAWS_STAND_INFO.LAWS_NO,
SAR_LAWS_STAND_INFO.ISSUE_TIME,
SAR_LAWS_STAND_INFO.ISSUE_COMPANY,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END,
SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE,
SAR_LAWS_STAND_INFO.LAWS_SYQY,
SAR_LAWS_STAND_INFO.LAWS_SYCX,
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
SAR_LAWS_STAND_INFO.LAWS_YEAR,
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
SAR_LAWS_STAND_INFO.LAWS_LABEL,
SAR_LAWS_STAND_INFO.LAWS_REMARK,
SAR_LAWS_STAND_INFO.COUNTRY,
SAR_LAWS_STAND_INFO.MODIFY_TIME
</sql>
<select id="selectStandardsInfoByKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List_Show"/>
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
from SAR_LAWS_STAND_INFO
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = a.LAWS_TEXT_STATE
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_LAWS_STAND_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
where SAR_LAWS_STAND_INFO.id = #{id}
</select>
<!-- 查询SAR_LAWS_STAND_INFO列表 -->
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select
a.*,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow,
(
CASE
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01'
ELSE SAR_LAWS_ATTR_INFO.XCXSSRQLAWS
END
) AS XCXSSRQLAWS
from
(select tmp_tb.* from
(
SELECT
DISTINCT SAR_LAWS_STAND_INFO.ID,
SAR_LAWS_STAND_INFO.LAWS_TYPE,
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
SAR_LAWS_STAND_INFO.LAWS_NAME,
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
SAR_LAWS_STAND_INFO.LAWS_NO,
SAR_LAWS_STAND_INFO.ISSUE_TIME,
SAR_LAWS_STAND_INFO.ISSUE_COMPANY,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END,
SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE,
SAR_LAWS_STAND_INFO.LAWS_SYQY,
SAR_LAWS_STAND_INFO.LAWS_SYCX,
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
SAR_LAWS_STAND_INFO.LAWS_YEAR,
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
SAR_LAWS_STAND_INFO.LAWS_LABEL,
SAR_LAWS_STAND_INFO.LAWS_REMARK,
SAR_LAWS_STAND_INFO.COUNTRY,
SAR_LAWS_STAND_INFO.MODIFY_TIME
from SAR_LAWS_STAND_INFO
<include refid="SarStandardsInfo_in_left"/>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
<include refid="SarStandardsInfo_out_left"/>
order by
${orderByA} ${order1},a.id
</select>
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select count(1) from (select count(*) from SAR_LAWS_STAND_INFO
left join SAR_LAWS_ATTR_INFO on (SAR_LAWS_ATTR_INFO.LAWS_ID = SAR_LAWS_STAND_INFO.id and SAR_LAWS_ATTR_INFO.valid_flag=0)
<include refid="SarStandardsInfo_in_left"/>
GROUP BY SAR_LAWS_STAND_INFO.id) a
</select>
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.standardSplit.entity.SarStandardsInfoEOPage">
select
a.*,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
from (select <include refid="Base_Column_List_Show"/>
from SAR_STANDARDS_INFO
<include refid="SarStandardsInfo_in_left"/>) a
<include refid="SarStandardsInfo_out_left"/>
order by a.issue_time is null,a.issue_time desc,a.id
</select>
</mapper>
@@ -0,0 +1,134 @@
<?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.sarLawsVal.dao.SarLawsValDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="valid_flag" property="validFlag" />
<result column="property_val" property="propertyVal" />
<result column="property_type" property="propertyType" />
<result column="LAWS_ID" property="lawsId" />
<result column="id" property="id" />
</resultMap>
<!-- SAR_LAWS_VAL table all fields -->
<sql id="Base_Column_List" >
modify_time, creation_time, valid_flag, property_val, property_type, laws_id, 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 &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="propertyVal != null" >
and property_val ${propertyValOperator} #{propertyVal}
</if>
<if test="propertyType != null" >
and property_type ${propertyTypeOperator} #{propertyType}
</if>
<if test="lawsId != null" >
and laws_id ${lawsIdOperator} #{lawsId}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
insert into SAR_LAWS_VAL(<include refid="Base_Column_List" />)
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{propertyVal, jdbcType=VARCHAR}, #{propertyType, jdbcType=VARCHAR}, #{lawsId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
insert into SAR_LAWS_VAL
<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="propertyVal != null" >property_val,</if>
<if test="propertyType != null" >property_type,</if>
<if test="lawsId != null" >laws_id,</if>
<if test="id != null" >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="propertyVal != null" >#{propertyVal, jdbcType=VARCHAR},</if>
<if test="propertyType != null" >#{propertyType, jdbcType=VARCHAR},</if>
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- SAR_LAWS_VAL 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_LAWS_VAL
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_LAWS_VAL列表 -->
<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_VAL
<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_VAL
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<delete id="deleteDataBylawsId" parameterType="java.lang.String">
delete from SAR_LAWS_VAL
where laws_id = #{lawsId}
</delete>
<insert id="insertForeach" parameterType="java.util.List">
insert into SAR_LAWS_VAL
(<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.propertyVal, jdbcType=VARCHAR},
#{item.propertyType, jdbcType=VARCHAR},
#{item.lawsId, jdbcType=VARCHAR},
#{item.id, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
@@ -687,17 +687,6 @@
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
@@ -710,6 +699,16 @@
)
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = a.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<trim suffixOverrides=",">
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})