feat: 提交项目代码
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
<?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.att.dao.AttFileEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.att.entity.AttFileEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="old_file_name" property="oldFileName" />
|
||||
<result column="file_suffix" property="fileSuffix" />
|
||||
<result column="file_path" property="filePath" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- ATT_FILE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
id, file_name, old_file_name, file_suffix, file_path, valid_flag, creation_time, modify_time
|
||||
</sql>
|
||||
|
||||
<update id="creatTableInfo" parameterType="java.lang.String" >
|
||||
CREATE TABLE ${tableName} (
|
||||
"ID" VARCHAR2(100 CHAR) NOT NULL PRIMARY KEY,
|
||||
"FILE_NAME" VARCHAR2(255 CHAR) NULL ,
|
||||
"OLD_FILE_NAME" VARCHAR2(255 CHAR) NULL ,
|
||||
"FILE_SUFFIX" VARCHAR2(30 CHAR) NULL ,
|
||||
"FILE_PATH" VARCHAR2(255 CHAR) NULL ,
|
||||
"VALID_FLAG" NUMBER(1) NULL ,
|
||||
"CREATION_TIME" DATE NULL ,
|
||||
"MODIFY_TIME" DATE NULL
|
||||
)
|
||||
LOGGING
|
||||
NOCOMPRESS
|
||||
NOCACHE
|
||||
</update>
|
||||
|
||||
<select id="existTable" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
select count(*) from user_tables where table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="fileName != null" >
|
||||
and file_name ${fileNameOperator} #{fileName}
|
||||
</if>
|
||||
<if test="oldFileName != null" >
|
||||
and old_file_name ${oldFileNameOperator} #{oldFileName}
|
||||
</if>
|
||||
<if test="fileSuffix != null" >
|
||||
and file_suffix ${fileSuffixOperator} #{fileSuffix}
|
||||
</if>
|
||||
<if test="filePath != null" >
|
||||
and file_path ${filePathOperator} #{filePath}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</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="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>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insertData" parameterType="com.adc.da.att.entity.AttFileEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_ATT_FILE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into ${tableName}(<include refid="Base_Column_List" />)
|
||||
values (#{id, jdbcType=VARCHAR}, #{fileName, jdbcType=VARCHAR}, #{oldFileName, jdbcType=VARCHAR}, #{fileSuffix, jdbcType=VARCHAR}, #{filePath, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
<select id="selectFileInfoById" resultMap="BaseResultMap" parameterType="com.adc.da.att.entity.AttFileEO">
|
||||
select <include refid="Base_Column_List" />
|
||||
from ${tableName}
|
||||
where id = #{id}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,376 @@
|
||||
<?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.person.dao.PersonCollectEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonCollectEO">
|
||||
<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="collect_res_id" property="collectResId"/>
|
||||
<result column="collect_info_uri" property="collectInfoUri"/>
|
||||
<result column="collect_title" property="collectTitle"/>
|
||||
<result column="collect_type" property="collectType"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_COLLECT table all fields -->
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
modify_time, creation_time, valid_flag, collect_res_id, collect_info_uri, collect_title, collect_type, user_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 >= #{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 = #{validFlag}
|
||||
</if>
|
||||
<if test="collectResId != null">
|
||||
and collect_res_id ${collectResIdOperator} #{collectResId}
|
||||
</if>
|
||||
<if test="collectInfoUri != null">
|
||||
and collect_info_uri ${collectInfoUriOperator} #{collectInfoUri}
|
||||
</if>
|
||||
<if test="collectTitle != null">
|
||||
and collect_title like concat(concat('%',#{collectTitle}),'%')
|
||||
</if>
|
||||
<if test="collectType != null">
|
||||
and collect_type ${collectTypeOperator} #{collectType}
|
||||
</if>
|
||||
<if test="collectTypeList != null and collectTypeList.size !=0">
|
||||
and collect_type IN
|
||||
<foreach collection="collectTypeList" item="collectTypeItem" index="index" open="(" close=")" separator=",">
|
||||
#{collectTypeItem}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="userId != null">
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Where_Clause_stand">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="modifyTime != null">
|
||||
and TS_PERSON_COLLECT.modify_time ${modifyTimeOperator} #{modifyTime}
|
||||
</if>
|
||||
<if test="modifyTime1 != null">
|
||||
and TS_PERSON_COLLECT.modify_time >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null">
|
||||
and TS_PERSON_COLLECT.modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creationTime != null">
|
||||
and TS_PERSON_COLLECT.creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null">
|
||||
and TS_PERSON_COLLECT.creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null">
|
||||
and TS_PERSON_COLLECT.creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and TS_PERSON_COLLECT.valid_flag = #{validFlag}
|
||||
</if>
|
||||
<if test="collectResId != null">
|
||||
and TS_PERSON_COLLECT.collect_res_id ${collectResIdOperator} #{collectResId}
|
||||
</if>
|
||||
<if test="collectInfoUri != null">
|
||||
and TS_PERSON_COLLECT.collect_info_uri ${collectInfoUriOperator} #{collectInfoUri}
|
||||
</if>
|
||||
<if test="collectTitle != null">
|
||||
and (
|
||||
CASE TS_PERSON_COLLECT.collect_type
|
||||
WHEN 'INLAND_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'FOREIGN_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'BUSINESS_STAND' THEN
|
||||
DECODE (
|
||||
SAR_BUSSIONESS_STAND.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || ')',
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || '-' || SAR_BUSSIONESS_STAND.stand_year|| ')'
|
||||
)
|
||||
ELSE
|
||||
TS_PERSON_COLLECT.collect_title
|
||||
END
|
||||
) like concat(concat('%',#{collectTitle}),'%')
|
||||
</if>
|
||||
<if test="collectType != null">
|
||||
and TS_PERSON_COLLECT.collect_type ${collectTypeOperator} #{collectType}
|
||||
</if>
|
||||
<if test="collectTypeList != null and collectTypeList.size !=0">
|
||||
and TS_PERSON_COLLECT.collect_type IN
|
||||
<foreach collection="collectTypeList" item="collectTypeItem" index="index" open="(" close=")" separator=",">
|
||||
#{collectTypeItem}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="userId != null">
|
||||
and TS_PERSON_COLLECT.user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and TS_PERSON_COLLECT.id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonCollectEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_COLLECT.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_COLLECT(<include refid="Base_Column_List"/>)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER},
|
||||
#{collectResId, jdbcType=VARCHAR}, #{collectInfoUri, jdbcType=VARCHAR}, #{collectTitle, jdbcType=VARCHAR},
|
||||
#{collectType, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonCollectEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_COLLECT.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_COLLECT
|
||||
<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="collectResId != null">collect_res_id,</if>
|
||||
<if test="collectInfoUri != null">collect_info_uri,</if>
|
||||
<if test="collectTitle != null">collect_title,</if>
|
||||
<if test="collectType != null">collect_type,</if>
|
||||
<if test="userId != null">user_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="collectResId != null">#{collectResId, jdbcType=VARCHAR},</if>
|
||||
<if test="collectInfoUri != null">#{collectInfoUri, jdbcType=VARCHAR},</if>
|
||||
<if test="collectTitle != null">#{collectTitle, jdbcType=VARCHAR},</if>
|
||||
<if test="collectType != null">#{collectType, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null">#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null">#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonCollectEO">
|
||||
update TS_PERSON_COLLECT
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
collect_res_id = #{collectResId},
|
||||
collect_info_uri = #{collectInfoUri},
|
||||
collect_title = #{collectTitle},
|
||||
collect_type = #{collectType},
|
||||
user_id = #{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonCollectEO">
|
||||
update TS_PERSON_COLLECT
|
||||
<set>
|
||||
<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="collectResId != null">
|
||||
collect_res_id = #{collectResId},
|
||||
</if>
|
||||
<if test="collectInfoUri != null">
|
||||
collect_info_uri = #{collectInfoUri},
|
||||
</if>
|
||||
<if test="collectTitle != null">
|
||||
collect_title = #{collectTitle},
|
||||
</if>
|
||||
<if test="collectType != null">
|
||||
collect_type = #{collectType},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_COLLECT -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COLLECT
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_COLLECT
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_COLLECT 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_COLLECT
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_COLLECT列表 -->
|
||||
<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 TS_PERSON_COLLECT
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
order by creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex} and valid_flag = 0
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分页查询-->
|
||||
<select id="queryByPersonCollectPage" resultMap="BaseResultMap" parameterType="com.adc.da.person.page.PersonCollectEOPage">
|
||||
select
|
||||
*
|
||||
from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select
|
||||
TS_PERSON_COLLECT.modify_time,
|
||||
TS_PERSON_COLLECT.creation_time,
|
||||
TS_PERSON_COLLECT.valid_flag,
|
||||
TS_PERSON_COLLECT.collect_res_id,
|
||||
TS_PERSON_COLLECT.collect_info_uri,
|
||||
TS_PERSON_COLLECT.collect_type,
|
||||
TS_PERSON_COLLECT.user_id,
|
||||
TS_PERSON_COLLECT.id,
|
||||
(
|
||||
CASE TS_PERSON_COLLECT.collect_type
|
||||
WHEN 'INLAND_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'FOREIGN_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'BUSINESS_STAND' THEN
|
||||
DECODE (
|
||||
SAR_BUSSIONESS_STAND.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || ')',
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || '-' || SAR_BUSSIONESS_STAND.stand_year|| ')'
|
||||
)
|
||||
ELSE
|
||||
TS_PERSON_COLLECT.collect_title
|
||||
END
|
||||
) AS collect_title
|
||||
from TS_PERSON_COLLECT
|
||||
LEFT JOIN SAR_STANDARDS_INFO ON TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO. ID
|
||||
LEFT JOIN TS_DICTYPE td1 ON (SAR_STANDARDS_INFO.STAND_SORT = td1.DIC_TYPE_CODE AND td1.valid_flag = 0 AND td1.PARENT_ID IS NULL)
|
||||
LEFT JOIN SAR_BUSSIONESS_STAND ON TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_BUSSIONESS_STAND. ID
|
||||
LEFT JOIN TS_DICTYPE td2 ON (SAR_BUSSIONESS_STAND.stand_sort = td2.DIC_TYPE_CODE AND td2.valid_flag = 0 AND td2.PARENT_ID IS NULL)
|
||||
<include refid="Base_Where_Clause_stand"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
order by TS_PERSON_COLLECT.creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByPersonCollectPageCount" resultType="java.lang.Integer" parameterType="com.adc.da.person.page.PersonCollectEOPage">
|
||||
select count(1)
|
||||
from TS_PERSON_COLLECT
|
||||
LEFT JOIN SAR_STANDARDS_INFO ON TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_STANDARDS_INFO. ID
|
||||
LEFT JOIN TS_DICTYPE td1 ON (SAR_STANDARDS_INFO.STAND_SORT = td1.DIC_TYPE_CODE AND td1.valid_flag = 0 AND td1.PARENT_ID IS NULL)
|
||||
LEFT JOIN SAR_BUSSIONESS_STAND ON TS_PERSON_COLLECT.COLLECT_RES_ID = SAR_BUSSIONESS_STAND. ID
|
||||
LEFT JOIN TS_DICTYPE td2 ON (SAR_BUSSIONESS_STAND.stand_sort = td2.DIC_TYPE_CODE AND td2.valid_flag = 0 AND td2.PARENT_ID IS NULL)
|
||||
<include refid="Base_Where_Clause_stand"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.person.page.PersonCollectEOPage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COLLECT
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="deleteByIdList" parameterType="java.util.List">
|
||||
delete from TS_PERSON_COLLECT
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,243 @@
|
||||
<?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.person.dao.PersonConfEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonConfEO" >
|
||||
<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="display_seq" property="displaySeq" />
|
||||
<result column="module_code" property="moduleCode" />
|
||||
<result column="module_name" property="moduleName" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_CONF table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, display_seq, module_code, module_name, user_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 >= #{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="displaySeq != null" >
|
||||
and display_seq ${displaySeqOperator} #{displaySeq}
|
||||
</if>
|
||||
<if test="moduleCode != null" >
|
||||
and module_code ${moduleCodeOperator} #{moduleCode}
|
||||
</if>
|
||||
<if test="moduleName != null" >
|
||||
and module_name ${moduleNameOperator} #{moduleName}
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonConfEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_CONF.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_CONF(<include refid="Base_Column_List" />)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{displaySeq, jdbcType=INTEGER}, #{moduleCode, jdbcType=VARCHAR}, #{moduleName, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonConfEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_CONF.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_CONF
|
||||
<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="displaySeq != null" >display_seq,</if>
|
||||
<if test="moduleCode != null" >module_code,</if>
|
||||
<if test="moduleName != null" >module_name,</if>
|
||||
<if test="userId != null" >user_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="displaySeq != null" >#{displaySeq, jdbcType=INTEGER},</if>
|
||||
<if test="moduleCode != null" >#{moduleCode, jdbcType=VARCHAR},</if>
|
||||
<if test="moduleName != null" >#{moduleName, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null" >#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonConfEO" >
|
||||
update TS_PERSON_CONF
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
display_seq = #{displaySeq},
|
||||
module_code = #{moduleCode},
|
||||
module_name = #{moduleName},
|
||||
user_id = #{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonConfEO">
|
||||
update TS_PERSON_CONF
|
||||
<set>
|
||||
<if test="modifyTime != null">
|
||||
modify_time = #{modifyTime},
|
||||
</if>
|
||||
<if test="creationTime != null">
|
||||
creation_time = #{creationTime},
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
valid_flag = 1,
|
||||
</if>
|
||||
<if test="displaySeq != null">
|
||||
display_seq = #{displaySeq},
|
||||
</if>
|
||||
<if test="moduleCode != null">
|
||||
module_code = #{moduleCode},
|
||||
</if>
|
||||
<if test="moduleName != null">
|
||||
module_name = #{moduleName},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_CONF -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TS_PERSON_CONF
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_CONF
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_CONF 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_CONF
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_CONF列表 -->
|
||||
<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 TS_PERSON_CONF
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_CONF
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insert1" parameterType="com.adc.da.person.entity.PersonConfEO">
|
||||
insert into TS_PERSON_CONF
|
||||
<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="displaySeq != null">display_seq,</if>
|
||||
<if test="moduleCode != null">module_code,</if>
|
||||
<if test="moduleName != null">module_name,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="id != null">id,</if>
|
||||
</trim> where valid_flag = 0
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--<!– 批量删除–>-->
|
||||
<!--<delete id="deleteByIdList" parameterType="java.lang.String">-->
|
||||
<!--delete from TS_PERSON_CONF where id=#{ids}-->
|
||||
<!--</delete>-->
|
||||
|
||||
<!-- 根据用户id,即当前登录人,查询 TS_PERSON_CONF -->
|
||||
<select id="selectByUserid" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TS_PERSON_CONF
|
||||
where user_id = #{userId} and valid_flag = 0 order by display_seq asc
|
||||
</select>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段,根据用户ID和code -->
|
||||
<update id="updateConfByUserIdModuleCode" parameterType="com.adc.da.person.entity.PersonConfEO">
|
||||
update TS_PERSON_CONF
|
||||
<set>
|
||||
<if test="modifyTime != null">
|
||||
modify_time = #{modifyTime},
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
<if test="displaySeq != null">
|
||||
display_seq = #{displaySeq},
|
||||
</if>
|
||||
</set>
|
||||
where 1=1
|
||||
<if test="moduleCode != null">
|
||||
and module_code = #{moduleCode}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,353 @@
|
||||
<?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.person.dao.PersonCookiesEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonCookiesEO">
|
||||
<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="res_uri" property="resUri"/>
|
||||
<result column="res_id" property="resId"/>
|
||||
<result column="res_title" property="resTitle"/>
|
||||
<result column="cookie_type" property="cookieType"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="resCount" property="resCount"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_COOKIES table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
modify_time, creation_time, valid_flag, res_uri, res_id, res_title, cookie_type, user_id, id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="modifyTime != null">
|
||||
and TS_PERSON_COOKIES.modify_time ${modifyTimeOperator} #{modifyTime}
|
||||
</if>
|
||||
<if test="modifyTime1 != null">
|
||||
and TS_PERSON_COOKIES.modify_time >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null">
|
||||
and TS_PERSON_COOKIES.modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creationTime != null">
|
||||
and TS_PERSON_COOKIES.creation_time ${creationTimeOperator} #{creationTime}
|
||||
</if>
|
||||
<if test="creationTime1 != null">
|
||||
and TS_PERSON_COOKIES.creation_time >= #{creationTime1}
|
||||
</if>
|
||||
<if test="creationTime2 != null">
|
||||
and TS_PERSON_COOKIES.creation_time <= #{creationTime2}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and TS_PERSON_COOKIES.valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="resUri != null">
|
||||
and TS_PERSON_COOKIES.res_uri ${resUriOperator} #{resUri}
|
||||
</if>
|
||||
<if test="resId != null">
|
||||
and TS_PERSON_COOKIES.res_id ${resIdOperator} #{resId}
|
||||
</if>
|
||||
<if test="resTitle != null">
|
||||
and TS_PERSON_COOKIES.res_title ${resTitleOperator} #{resTitle}
|
||||
</if>
|
||||
<if test="cookieType != null">
|
||||
and TS_PERSON_COOKIES.cookie_type ${cookieTypeOperator} #{cookieType}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and TS_PERSON_COOKIES.user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and TS_PERSON_COOKIES.id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_COOKIES.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_COOKIES(<include refid="Base_Column_List"/>)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER},
|
||||
#{resUri, jdbcType=VARCHAR}, #{resId, jdbcType=VARCHAR}, #{resTitle, jdbcType=VARCHAR},
|
||||
#{cookieType, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_COOKIES.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_COOKIES
|
||||
<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="resUri != null">res_uri,</if>
|
||||
<if test="resId != null">res_id,</if>
|
||||
<if test="resTitle != null">res_title,</if>
|
||||
<if test="cookieType != null">cookie_type,</if>
|
||||
<if test="userId != null">user_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="resUri != null">#{resUri, jdbcType=VARCHAR},</if>
|
||||
<if test="resId != null">#{resId, jdbcType=VARCHAR},</if>
|
||||
<if test="resTitle != null">#{resTitle, jdbcType=VARCHAR},</if>
|
||||
<if test="cookieType != null">#{cookieType, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null">#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null">#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
update TS_PERSON_COOKIES
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
res_uri = #{resUri},
|
||||
res_id = #{resId},
|
||||
res_title = #{resTitle},
|
||||
cookie_type = #{cookieType},
|
||||
user_id = #{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
update TS_PERSON_COOKIES
|
||||
<set>
|
||||
<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="resUri != null">
|
||||
res_uri = #{resUri},
|
||||
</if>
|
||||
<if test="resId != null">
|
||||
res_id = #{resId},
|
||||
</if>
|
||||
<if test="resTitle != null">
|
||||
res_title = #{resTitle},
|
||||
</if>
|
||||
<if test="cookieType != null">
|
||||
cookie_type = #{cookieType},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByAll" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
update TS_PERSON_COOKIES
|
||||
set
|
||||
valid_flag = 1 where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_COOKIES -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COOKIES
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_COOKIES
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_COOKIES 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_COOKIES
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_COOKIES列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select *
|
||||
from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select
|
||||
TS_PERSON_COOKIES.modify_time, TS_PERSON_COOKIES.creation_time, TS_PERSON_COOKIES.valid_flag,
|
||||
TS_PERSON_COOKIES.res_uri, TS_PERSON_COOKIES.res_id, TS_PERSON_COOKIES.cookie_type, TS_PERSON_COOKIES.user_id, TS_PERSON_COOKIES.id,
|
||||
(
|
||||
CASE COOKIE_TYPE
|
||||
WHEN 'INLAND_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'FOREIGN_STAND' THEN
|
||||
DECODE (
|
||||
SAR_STANDARDS_INFO.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || ')',
|
||||
SAR_STANDARDS_INFO.stand_name || ' (' || td1.DIC_TYPE_NAME || ' ' || SAR_STANDARDS_INFO.stand_number || '-' || SAR_STANDARDS_INFO.stand_year|| ')'
|
||||
)
|
||||
WHEN 'BUSINESS_STAND' THEN
|
||||
DECODE (
|
||||
SAR_BUSSIONESS_STAND.STAND_YEAR,
|
||||
NULL,
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || ')',
|
||||
SAR_BUSSIONESS_STAND.stand_name || ' (' || td2.DIC_TYPE_NAME || ' ' || SAR_BUSSIONESS_STAND.stand_code || '-' || SAR_BUSSIONESS_STAND.stand_year|| ')'
|
||||
)
|
||||
ELSE
|
||||
TS_PERSON_COOKIES.res_title
|
||||
END
|
||||
) AS res_title
|
||||
from TS_PERSON_COOKIES
|
||||
LEFT JOIN SAR_STANDARDS_INFO ON TS_PERSON_COOKIES.RES_ID = SAR_STANDARDS_INFO. ID
|
||||
LEFT JOIN TS_DICTYPE td1 ON ( SAR_STANDARDS_INFO.STAND_SORT = td1.DIC_TYPE_CODE AND td1.valid_flag = 0 AND td1.PARENT_ID IS NULL )
|
||||
LEFT JOIN SAR_BUSSIONESS_STAND ON TS_PERSON_COOKIES.RES_ID = SAR_BUSSIONESS_STAND. ID
|
||||
LEFT JOIN TS_DICTYPE td2 ON (SAR_BUSSIONESS_STAND.stand_sort = td2.DIC_TYPE_CODE AND td2.valid_flag = 0 AND td2.PARENT_ID IS NULL)
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
order by TS_PERSON_COOKIES.creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COOKIES
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据浏览资源类型查看用户浏览过的内容-->
|
||||
<select id="queryByCookieType" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COOKIES
|
||||
where cookie_type=#{cookieType, jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据用户id查询浏览记录-->
|
||||
<select id="queryByUserId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_COOKIES
|
||||
where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据用户id删除浏览记录-->
|
||||
<update id="updateByUserId" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
update TS_PERSON_COOKIES
|
||||
set
|
||||
valid_flag = 1
|
||||
where id=#{id}
|
||||
<if test="userId != null">
|
||||
and user_id=#{userId}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 批量删除-->
|
||||
<update id="update" parameterType="java.lang.String">
|
||||
update TS_PERSON_COOKIES
|
||||
set valid_flag = 1
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--liwenxuan:标准法规被查阅次数:国内标准\国内法规\国外标准法规\企业标准-->
|
||||
<select id="MonthlyNumberOfDomesticStandards" resultType="java.lang.String">
|
||||
|
||||
SELECT resCount FROM(
|
||||
SELECT
|
||||
RES_TITLE||'('||COUNT (1)|| ')' AS resCount
|
||||
FROM
|
||||
TS_PERSON_COOKIES
|
||||
WHERE
|
||||
CREATION_TIME <= #{visitTime}
|
||||
AND COOKIE_TYPE = #{cookieType}
|
||||
GROUP BY
|
||||
RES_TITLE
|
||||
ORDER BY COUNT(1) DESC
|
||||
)
|
||||
WHERE ROWNUM <= 10
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!--liwenxuan:数据报表的系统用户访问数量-->
|
||||
<select id="sysUserVisitCount" parameterType="Date" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from
|
||||
ts_person_cookies
|
||||
WHERE ts_person_cookies.MODIFY_TIME > #{visitTime}
|
||||
</select>
|
||||
<!--bayulei:数据报表动态信息访问量-->
|
||||
<select id="selectMsgConsultNumber" parameterType="java.util.Date" resultType="java.lang.String">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
max( TS_PERSON_COOKIES.RES_TITLE ) || '(' || COUNT( 1 ) || ')' AS resCount
|
||||
FROM
|
||||
MSG_DYNAMIC_INFO left join TS_PERSON_COOKIES on MSG_DYNAMIC_INFO.ID=TS_PERSON_COOKIES.RES_ID
|
||||
WHERE
|
||||
( TS_PERSON_COOKIES.COOKIE_TYPE = 'INLAND_MSG' OR TS_PERSON_COOKIES.COOKIE_TYPE = 'FOREIGN_MSG' )
|
||||
and MSG_DYNAMIC_INFO.VALID_FLAG=0
|
||||
GROUP BY
|
||||
TS_PERSON_COOKIES.RES_ID
|
||||
ORDER BY
|
||||
COUNT( 1 ) DESC
|
||||
)
|
||||
WHERE
|
||||
ROWNUM <= 10
|
||||
|
||||
</select>
|
||||
|
||||
<select id="countPageCookie" resultType="java.lang.Integer" parameterType="com.adc.da.person.entity.PersonCookiesEO">
|
||||
select count(1) from TS_PERSON_COOKIES
|
||||
where res_id = #{resId}
|
||||
</select>
|
||||
|
||||
<update id="deleteByIdList" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_COOKIES SET valid_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,243 @@
|
||||
<?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.person.dao.PersonMsgEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonMsgEO" >
|
||||
<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="read_flag" property="readFlag" />
|
||||
<result column="msg_content" property="msgContent" />
|
||||
<result column="msg_title" property="msgTitle" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="processnum" property="processnum" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_MSG table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, read_flag, msg_content, msg_title, user_id, id,processnum
|
||||
</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="readFlag != null" >
|
||||
and read_flag ${readFlagOperator} #{readFlag}
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
and msg_content ${msgContentOperator} #{msgContent}
|
||||
</if>
|
||||
<if test="msgTitle != null" >
|
||||
and msg_title ${msgTitleOperator} concat(concat('%',#{msgTitle}),'%')
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="processnum != null" >
|
||||
and processnum ${processnumOperator} #{processnum}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonMsgEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_MSG.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_MSG(<include refid="Base_Column_List" />)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{readFlag, jdbcType=INTEGER}, #{msgContent, jdbcType=VARCHAR}, #{msgTitle, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{processnum, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonMsgEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_MSG.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_MSG
|
||||
<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="readFlag != null" >read_flag,</if>
|
||||
<if test="msgContent != null" >msg_content,</if>
|
||||
<if test="msgTitle != null" >msg_title,</if>
|
||||
<if test="userId != null" >user_id,</if>
|
||||
<if test="id != null" >id,</if>
|
||||
<if test="processnum != null" >processnum,</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="readFlag != null" >#{readFlag, jdbcType=INTEGER},</if>
|
||||
<if test="msgContent != null" >#{msgContent, jdbcType=VARCHAR},</if>
|
||||
<if test="msgTitle != null" >#{msgTitle, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null" >#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
<if test="processnum != null" >#{processnum, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonMsgEO" >
|
||||
update TS_PERSON_MSG
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
read_flag = #{readFlag},
|
||||
msg_content = #{msgContent},
|
||||
msg_title = #{msgTitle},
|
||||
user_id = #{userId},
|
||||
processnum = #{processnum}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonMsgEO" >
|
||||
update TS_PERSON_MSG
|
||||
<set >
|
||||
<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="readFlag != null" >
|
||||
read_flag = #{readFlag},
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
msg_content = #{msgContent},
|
||||
</if>
|
||||
<if test="msgTitle != null" >
|
||||
msg_title = #{msgTitle},
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="processnum != null" >
|
||||
processnum = #{processnum},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_MSG -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TS_PERSON_MSG
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_MSG
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_MSG 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_MSG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_MSG列表 -->
|
||||
<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 TS_PERSON_MSG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
order by creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_PERSON_MSG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByInfoId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List"/> from TS_PERSON_MSG
|
||||
where id=#{id} and valid_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- 查询用户未读动态-->
|
||||
<select id="selectByNotRed" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_MSG
|
||||
where user_id=#{userId} and read_flag=0 and valid_flag=0
|
||||
</select>
|
||||
|
||||
<update id="deleteByIdList" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_SHARE SET valid_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="deletePersonMsgByIdList" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_MSG SET valid_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="markIsReadByBatch" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_MSG SET read_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,237 @@
|
||||
<?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.person.dao.PersonNoteEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonNoteEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="creartion_time" property="creartionTime"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="note_content" property="noteContent" jdbcType="LONGVARBINARY"/>
|
||||
<result column="res_type" property="resType"/>
|
||||
<result column="res_id" property="resId"/>
|
||||
<result column="collect_id" property="collectId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_NOTE table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
modify_time, creartion_time, valid_flag, res_type, res_id, collect_id, user_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 >= #{modifyTime1}
|
||||
</if>
|
||||
<if test="modifyTime2 != null">
|
||||
and modify_time <= #{modifyTime2}
|
||||
</if>
|
||||
<if test="creartionTime != null">
|
||||
and creartion_time ${creartionTimeOperator} #{creartionTime}
|
||||
</if>
|
||||
<if test="creartionTime1 != null">
|
||||
and creartion_time >= #{creartionTime1}
|
||||
</if>
|
||||
<if test="creartionTime2 != null">
|
||||
and creartion_time <= #{creartionTime2}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="noteContent != null">
|
||||
and note_content ${noteContentOperator} #{noteContent}
|
||||
</if>
|
||||
<if test="resType != null">
|
||||
and res_type ${resTypeOperator} #{resType}
|
||||
</if>
|
||||
<if test="resId != null">
|
||||
and res_id ${resIdOperator} #{resId}
|
||||
</if>
|
||||
<if test="collectId != null">
|
||||
and collect_id ${collectIdOperator} #{collectId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_NOTE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_NOTE(<include refid="Base_Column_List"/>)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creartionTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER},
|
||||
#{noteContent, jdbcType=VARCHAR}, #{resType, jdbcType=VARCHAR}, #{resId, jdbcType=VARCHAR},
|
||||
#{collectId, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_NOTE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_NOTE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="modifyTime != null">modify_time,</if>
|
||||
<if test="creartionTime != null">creartion_time,</if>
|
||||
<if test="validFlag != null">valid_flag,</if>
|
||||
<if test="noteContent != null">note_content,</if>
|
||||
<if test="resType != null">res_type,</if>
|
||||
<if test="resId != null">res_id,</if>
|
||||
<if test="collectId != null">collect_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="id != null">id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="modifyTime != null">#{modifyTime, jdbcType=TIMESTAMP},</if>
|
||||
<if test="creartionTime != null">#{creartionTime, jdbcType=TIMESTAMP},</if>
|
||||
<if test="validFlag != null">#{validFlag, jdbcType=INTEGER},</if>
|
||||
<if test="noteContent != null">#{noteContent, jdbcType=VARCHAR},</if>
|
||||
<if test="resType != null">#{resType, jdbcType=VARCHAR},</if>
|
||||
<if test="resId != null">#{resId, jdbcType=VARCHAR},</if>
|
||||
<if test="collectId != null">#{collectId, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null">#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null">#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
update TS_PERSON_NOTE
|
||||
set modify_time = #{modifyTime},
|
||||
creartion_time = #{creartionTime},
|
||||
valid_flag = #{validFlag},
|
||||
note_content = #{noteContent},
|
||||
res_type = #{resType},
|
||||
res_id = #{resId},
|
||||
collect_id = #{collectId},
|
||||
user_id = #{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
update TS_PERSON_NOTE
|
||||
<set>
|
||||
<if test="modifyTime != null">
|
||||
modify_time = #{modifyTime},
|
||||
</if>
|
||||
<if test="creartionTime != null">
|
||||
creartion_time = #{creartionTime},
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
<if test="noteContent != null">
|
||||
note_content = #{noteContent},
|
||||
</if>
|
||||
<if test="resType != null">
|
||||
res_type = #{resType},
|
||||
</if>
|
||||
<if test="resId != null">
|
||||
res_id = #{resId},
|
||||
</if>
|
||||
<if test="collectId != null">
|
||||
collect_id = #{collectId},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_NOTE -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_NOTE
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_NOTE
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_NOTE 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_NOTE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_NOTE列表 -->
|
||||
<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 TS_PERSON_NOTE
|
||||
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_PERSON_NOTE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据收藏id修改笔记内容 -->
|
||||
<update id="updateByCollectId" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
update TS_PERSON_NOTE set note_Content =#{noteContent} where collect_Id = #{collectId,jdbcType=VARCHAR} and id = #{id} and valid_flag = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!--<!– 根据收藏id查询笔记–>-->
|
||||
<select id="queryByCollectId" resultMap="BaseResultMap" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
select
|
||||
u.modify_time,
|
||||
u.creartion_time,
|
||||
u.valid_flag,
|
||||
u.res_type,
|
||||
u.res_id,
|
||||
u.collect_id,
|
||||
u.user_id,
|
||||
u.id,
|
||||
u.note_content
|
||||
from
|
||||
TS_PERSON_NOTE u where u.collect_id=#{collectId,jdbcType=VARCHAR} and valid_flag=0
|
||||
</select>
|
||||
|
||||
|
||||
<update id="update" parameterType="com.adc.da.person.entity.PersonNoteEO">
|
||||
update TS_PERSON_NOTE
|
||||
set
|
||||
valid_flag=1
|
||||
where id = #{id} and collect_id=#{collectId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,165 @@
|
||||
<?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.person.dao.PersonSearchEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonSearchEO" >
|
||||
<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="search_content" property="searchContent" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_SEARCH table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, search_content, user_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 >= #{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="searchContent != null" >
|
||||
and search_content ${searchContentOperator} concat(concat('%',#{searchContent}),'%')
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonSearchEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_SEARCH.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_SEARCH(<include refid="Base_Column_List" />)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{searchContent, jdbcType=VARCHAR}, #{userId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonSearchEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_SEARCH.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_SEARCH
|
||||
<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="searchContent != null" >search_content,</if>
|
||||
<if test="userId != null" >user_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="searchContent != null" >#{searchContent, jdbcType=VARCHAR},</if>
|
||||
<if test="userId != null" >#{userId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonSearchEO" >
|
||||
update TS_PERSON_SEARCH
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
search_content = #{searchContent},
|
||||
user_id = #{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonSearchEO" >
|
||||
update TS_PERSON_SEARCH
|
||||
<set >
|
||||
<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="searchContent != null" >
|
||||
search_content = #{searchContent},
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_SEARCH -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TS_PERSON_SEARCH
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_SEARCH
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_SEARCH 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_SEARCH
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_SEARCH列表 -->
|
||||
<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 TS_PERSON_SEARCH
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_PERSON_SEARCH
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,243 @@
|
||||
<?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.person.dao.PersonShareEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.person.entity.PersonShareEO" >
|
||||
<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="read_flag" property="readFlag" />
|
||||
<result column="res_title" property="resTitle" />
|
||||
<result column="res_uri" property="resUri" />
|
||||
<result column="res_id" property="resId" />
|
||||
<result column="res_type" property="resType" />
|
||||
<result column="share_user_id" property="shareUserId" />
|
||||
<result column="recipient_id" property="recipientId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_PERSON_SHARE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag,f_valid_flag, read_flag, res_title, res_uri, res_id, res_type, share_user_id, recipient_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 >= #{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="fvalidFlag != null" >
|
||||
and f_valid_flag ${validFlagOperator} #{fvalidFlag}
|
||||
</if>
|
||||
<if test="fvalidFlag != null" >
|
||||
and f_valid_flag ${fvalidFlagOperator} #{fvalidFlag}
|
||||
</if>
|
||||
<if test="resTitle != null" >
|
||||
and res_title ${resTitleOperator} concat(concat('%',#{resTitle}),'%')
|
||||
</if>
|
||||
<if test="resUri != null" >
|
||||
and res_uri ${resUriOperator} #{resUri}
|
||||
</if>
|
||||
<if test="resId != null" >
|
||||
and res_id ${resIdOperator} #{resId}
|
||||
</if>
|
||||
<if test="resType != null" >
|
||||
and res_type ${resTypeOperator} #{resType}
|
||||
</if>
|
||||
<if test="shareUserId != null" >
|
||||
and share_user_id ${shareUserIdOperator} #{shareUserId}
|
||||
</if>
|
||||
<if test="recipientId != null" >
|
||||
and recipient_id ${recipientIdOperator} #{recipientId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.person.entity.PersonShareEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_SHARE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_SHARE(<include refid="Base_Column_List" />)
|
||||
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER},#{fvalidFlag, jdbcType=INTEGER}, #{readFlag, jdbcType=INTEGER}, #{resTitle, jdbcType=VARCHAR}, #{resUri, jdbcType=VARCHAR}, #{resId, jdbcType=VARCHAR}, #{resType, jdbcType=VARCHAR}, #{shareUserId, jdbcType=VARCHAR}, #{recipientId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.person.entity.PersonShareEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_TS_PERSON_SHARE.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_PERSON_SHARE
|
||||
<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="fvalidFlag != null" >f_valid_flag,</if>
|
||||
<if test="readFlag != null" >read_flag,</if>
|
||||
<if test="resTitle != null" >res_title,</if>
|
||||
<if test="resUri != null" >res_uri,</if>
|
||||
<if test="resId != null" >res_id,</if>
|
||||
<if test="resType != null" >res_type,</if>
|
||||
<if test="shareUserId != null" >share_user_id,</if>
|
||||
<if test="recipientId != null" >recipient_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="fvalidFlag != null" >#{fvalidFlag, jdbcType=INTEGER},</if>
|
||||
<if test="readFlag != null" >#{readFlag, jdbcType=INTEGER},</if>
|
||||
<if test="resTitle != null" >#{resTitle, jdbcType=VARCHAR},</if>
|
||||
<if test="resUri != null" >#{resUri, jdbcType=VARCHAR},</if>
|
||||
<if test="resId != null" >#{resId, jdbcType=VARCHAR},</if>
|
||||
<if test="resType != null" >#{resType, jdbcType=VARCHAR},</if>
|
||||
<if test="shareUserId != null" >#{shareUserId, jdbcType=VARCHAR},</if>
|
||||
<if test="recipientId != null" >#{recipientId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.person.entity.PersonShareEO" >
|
||||
update TS_PERSON_SHARE
|
||||
set modify_time = #{modifyTime},
|
||||
creation_time = #{creationTime},
|
||||
valid_flag = #{validFlag},
|
||||
read_flag = #{readFlag},
|
||||
res_title = #{resTitle},
|
||||
res_uri = #{resUri},
|
||||
res_id = #{resId},
|
||||
res_type = #{resType},
|
||||
share_user_id = #{shareUserId},
|
||||
recipient_id = #{recipientId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.person.entity.PersonShareEO" >
|
||||
update TS_PERSON_SHARE
|
||||
<set >
|
||||
<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="readFlag != null" >
|
||||
read_flag = #{readFlag},
|
||||
</if>
|
||||
<if test="resTitle != null" >
|
||||
res_title = #{resTitle},
|
||||
</if>
|
||||
<if test="resUri != null" >
|
||||
res_uri = #{resUri},
|
||||
</if>
|
||||
<if test="resId != null" >
|
||||
res_id = #{resId},
|
||||
</if>
|
||||
<if test="resType != null" >
|
||||
res_type = #{resType},
|
||||
</if>
|
||||
<if test="shareUserId != null" >
|
||||
share_user_id = #{shareUserId},
|
||||
</if>
|
||||
<if test="recipientId != null" >
|
||||
recipient_id = #{recipientId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 TS_PERSON_SHARE -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from TS_PERSON_SHARE
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from TS_PERSON_SHARE
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<!-- TS_PERSON_SHARE 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_PERSON_SHARE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_PERSON_SHARE列表 -->
|
||||
<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 TS_PERSON_SHARE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
order by creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_PERSON_SHARE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="deleteByIdList" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_SHARE SET valid_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="deleteByIdListForward" parameterType="java.util.List">
|
||||
UPDATE TS_PERSON_SHARE SET f_valid_flag = 1
|
||||
<where>
|
||||
<if test="idList != null">
|
||||
"ID" IN
|
||||
<foreach close=")" separator="," open="(" item="item" index="index" collection="idList">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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.sys.dao.FeedbackInfoEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.FeedbackInfoEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="feedback_info" property="feedbackInfo" jdbcType="LONGVARBINARY"/>
|
||||
<result column="read_flag" property="readFlag"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<!--新增-->
|
||||
<result column="duty" property="duty"/>
|
||||
<result column="officePhone" property="officePhone"/>
|
||||
<result column="mobilePhone" property="mobilePhone"/>
|
||||
<result column="uname" property="uname"/>
|
||||
<result column="orgName" property="orgName"/>
|
||||
<result column="content_text" property="contentText"/>
|
||||
</resultMap>
|
||||
|
||||
<!--为了意见反馈的回显-->
|
||||
<sql id="Base_Column_ListFeedbackInfoAndUserInfo">
|
||||
TFI.id, TFI.user_id, TFI.feedback_info, TFI.read_flag, TFI.valid_flag, TFI.creation_time, TFI.modify_time,TFI.content_text
|
||||
,TUI.duty AS duty,TUI.office_phone AS officePhone,TUI.mobile_phone AS mobilePhone,TU.uname AS uname,tor.ORG_NAME AS orgName
|
||||
</sql>
|
||||
<!-- TS_FEEDBACK_INFO table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, feedback_info, read_flag, valid_flag, creation_time, modify_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1 and TFI.valid_flag =0
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="selfId != null">
|
||||
and TFI.user_id = #{selfId}
|
||||
</if>
|
||||
<if test="feedbackInfo != null">
|
||||
and feedback_info ${feedbackInfoOperator} #{feedbackInfo}
|
||||
</if>
|
||||
<if test="readFlag != null">
|
||||
and read_flag ${readFlagOperator} #{readFlag}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</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="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="uname != null">
|
||||
and UNAME like '%${uname}%'
|
||||
</if>
|
||||
<if test="orgType != null">
|
||||
and ORG_TYPE = #{orgType}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- TS_FEEDBACK_INFO 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_FEEDBACK_INFO TFI
|
||||
LEFT JOIN TS_USER_INFO TUI on TFI.user_id = TUI.user_id
|
||||
LEFT JOIN TS_USER TU ON TU.usid = TUI.user_id
|
||||
LEFT JOIN TS_USER_ORG TUO ON TU.usid =tuo.USER_ID
|
||||
LEFT JOIN ts_org tor ON tor.id =tuo.org_id
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_FEEDBACK_INFO列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select * from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select
|
||||
<include refid="Base_Column_ListFeedbackInfoAndUserInfo"/>
|
||||
from TS_FEEDBACK_INFO TFI
|
||||
LEFT JOIN TS_USER_INFO TUI on TFI.user_id = TUI.user_id
|
||||
LEFT JOIN TS_USER TU ON TU.usid = TUI.user_id
|
||||
LEFT JOIN TS_USER_ORG TUO ON TU.usid =tuo.USER_ID
|
||||
LEFT JOIN ts_org tor ON tor.id =tuo.org_id
|
||||
<include refid="Base_Where_Clause"/> order by creation_time desc
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_FEEDBACK_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?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.sys.dao.LinkInfoEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.LinkInfoEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="web_name" property="webName" />
|
||||
<result column="old_web_site" property="oldWebSite" />
|
||||
<result column="new_web_site" property="newWebSite" />
|
||||
<result column="display_seq" property="displaySeq" />
|
||||
<result column="is_show" property="isShow" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_LINK_INFO table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
id, web_name, old_web_site, new_web_site, display_seq, is_show, valid_flag, creation_time, modify_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="webName != null" >
|
||||
and web_name ${webNameOperator} #{webName}
|
||||
</if>
|
||||
<if test="oldWebSite != null" >
|
||||
and old_web_site ${oldWebSiteOperator} #{oldWebSite}
|
||||
</if>
|
||||
<if test="newWebSite != null" >
|
||||
and new_web_site ${newWebSiteOperator} #{newWebSite}
|
||||
</if>
|
||||
<if test="displaySeq != null" >
|
||||
and display_seq ${displaySeqOperator} #{displaySeq}
|
||||
</if>
|
||||
<if test="isShow != null" >
|
||||
and is_show ${isShowOperator} #{isShow}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</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="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>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- TS_LINK_INFO 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_LINK_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_LINK_INFO列表 -->
|
||||
<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 TS_LINK_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_LINK_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteByIds" parameterType="java.util.List">
|
||||
delete from TS_LINK_INFO
|
||||
where id in
|
||||
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,146 @@
|
||||
<?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.sys.dao.LoginInfoEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.LoginInfoEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
<result column="login_address" property="loginAddress" />
|
||||
<result column="login_time" property="loginTime" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_LOGIN_INFO table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, login_address, login_time, user_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 >= #{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="loginAddress != null" >
|
||||
and login_address ${loginAddressOperator} #{loginAddress}
|
||||
</if>
|
||||
<if test="loginTime != null" >
|
||||
and login_time ${loginTimeOperator} #{loginTime}
|
||||
</if>
|
||||
<if test="loginTime1 != null" >
|
||||
and login_time >= #{loginTime1}
|
||||
</if>
|
||||
<if test="loginTime2 != null" >
|
||||
and login_time <= #{loginTime2}
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- TS_LOGIN_INFO 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_LOGIN_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_LOGIN_INFO列表 -->
|
||||
<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 TS_LOGIN_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_LOGIN_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:系统用户访问数量-->
|
||||
<select id="sysUserVisitCount" parameterType="java.util.Date" resultType="java.lang.String">
|
||||
SELECT * FROM(
|
||||
SELECT
|
||||
a.UNAME||'('||count(USER_ID)||')' as uNameCount
|
||||
FROM
|
||||
TS_USER a left join TS_LOGIN_INFO b ON a.USID = b.USER_ID
|
||||
where
|
||||
b.modify_time > #{visitTime} and a.Valid_Flag =0
|
||||
GROUP BY
|
||||
a.UNAME
|
||||
ORDER BY count(USER_ID) DESC)
|
||||
where
|
||||
rownum <=10
|
||||
</select>
|
||||
<select id="sysUserVisitCountByDate" parameterType="com.adc.da.sys.entity.LoginInfoEO" resultType="com.adc.da.sys.entity.LoginInfoEO">
|
||||
select * from (
|
||||
select count(LOGIN_TIME) as countNum,to_char(LOGIN_TIME,'yyyy-MM-dd') as maxCountDate
|
||||
from TS_LOGIN_INFO where 1=1
|
||||
<if test="modifyTime != null">
|
||||
and login_time > #{modifyTime}
|
||||
</if>
|
||||
GROUP BY to_char(LOGIN_TIME,'yyyy-MM-dd')
|
||||
ORDER BY countNum desc
|
||||
)
|
||||
where
|
||||
rownum <=1
|
||||
</select>
|
||||
|
||||
<select id="sysUserVisitCountByAll" parameterType="com.adc.da.sys.entity.LoginInfoEO" resultType="java.lang.Integer">
|
||||
SELECT count(*) FROM
|
||||
TS_LOGIN_INFO
|
||||
where 1=1
|
||||
<if test="modifyTime != null">
|
||||
and login_time > #{modifyTime}
|
||||
</if>
|
||||
</select>
|
||||
<!--liwenxuan:系统用户访问数量-->
|
||||
<select id="sysUserVisitCountTop10" resultType="java.lang.String">
|
||||
|
||||
SELECT * FROM
|
||||
(SELECT
|
||||
a.UNAME||'('||count(USER_ID)||')' as uNameCount
|
||||
FROM
|
||||
TS_USER a left join TS_LOGIN_INFO b ON a.USID = b.USER_ID
|
||||
WHERE
|
||||
a.Valid_Flag =0
|
||||
GROUP BY
|
||||
a.UNAME
|
||||
ORDER BY count(USER_ID) DESC)
|
||||
WHERE
|
||||
rownum <=10
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="java.lang.Integer">
|
||||
SELECT count(1) from TS_LOGIN_INFO
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,180 @@
|
||||
<?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.sys.dao.MenuEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.MenuEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="parent_ids" property="parentIds"/>
|
||||
<result column="href" property="href"/>
|
||||
<result column="icon" property="icon"/>
|
||||
<result column="is_show" property="isShow"/>
|
||||
<result column="permission" property="permission"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="creation_time" property="creationTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_MENU table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
id, valid_flag, name, parent_id, parent_ids, href, icon, is_show, permission, remarks,modify_time, creation_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and name ${nameOperator} #{name}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id ${parentIdOperator} #{parentId}
|
||||
</if>
|
||||
<if test="parentIds != null">
|
||||
and parent_ids ${parentIdsOperator} #{parentIds}
|
||||
</if>
|
||||
<if test="href != null">
|
||||
and href ${hrefOperator} #{href}
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
and icon ${iconOperator} #{icon}
|
||||
</if>
|
||||
<if test="isShow != null">
|
||||
and is_show ${isShowOperator} #{isShow}
|
||||
</if>
|
||||
<if test="permission != null">
|
||||
and permission ${permissionOperator} #{permission}
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
and remarks ${remarksOperator} #{remarks}
|
||||
</if>
|
||||
<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>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<update id="deleteMenuLogic">
|
||||
UPDATE TS_MENU set valid_flag = ${@com.adc.da.util.constant.DeleteFlagEnum@DELETE.getValue()}
|
||||
WHERE id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteRoleMenus">
|
||||
DELETE FROM TS_ROLE_MENU where MENU_ID in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
or MENU_ID in (
|
||||
select ID from TS_MENU where
|
||||
<foreach collection="array" item="id" open="" separator="or" close="">
|
||||
PARENT_IDS like '%'||#{id}||'%'
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
|
||||
<!-- TS_MENU 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_MENU列表 -->
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from (select t.*,rownum rownu from TS_MENU t
|
||||
where rownum<=${pager.endIndex})tt
|
||||
where tt.rownu>=${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM TS_MENU
|
||||
WHERE valid_flag = ${@com.adc.da.util.constant.DeleteFlagEnum@NORMAL.getValue()}
|
||||
ORDER BY IS_SHOW ASC
|
||||
</select>
|
||||
|
||||
<!-- 屏蔽掉 禁止的,只显示启动的 菜单 -->
|
||||
<select id="listMenuEOByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
MENU.id,MENU.valid_flag,MENU.name,MENU .parent_id,MENU.parent_ids,MENU.href,MENU.icon,
|
||||
MENU.is_show,MENU.PERMISSION
|
||||
FROM (
|
||||
SELECT
|
||||
M.id, MAX(M.valid_flag) valid_flag, MAX(M.name) name, MAX(M.parent_id) parent_id,
|
||||
MAX(M.parent_ids) parent_ids, MAX(M.href) href, MAX(M.icon) icon, MAX(M.is_show) is_show, MAX(M.permission) permission
|
||||
FROM TS_MENU M
|
||||
LEFT JOIN TS_ROLE_MENU RM ON RM.MENU_ID = M.ID
|
||||
LEFT JOIN TS_USER_ROLE UR ON UR.ROLE_ID = RM.ROLE_ID
|
||||
LEFT JOIN TS_ROLE TR ON TR.ID = UR.ROLE_ID
|
||||
WHERE UR.USER_ID = #{userId} AND TR.USE_FLAG = 0
|
||||
GROUP BY M.id
|
||||
) MENU
|
||||
ORDER BY MENU.IS_SHOW ASC
|
||||
</select>
|
||||
|
||||
<select id="getChildMenus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM TS_MENU
|
||||
WHERE PARENT_IDS like '%' || #{parentId} || '%'
|
||||
</select>
|
||||
|
||||
<select id="isBelong" resultType="integer">
|
||||
SELECT count(1) from TS_ROLE_MENU where ROLE_ID = #{roleId} and MENU_ID = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="listMenuEOByRoleID" resultType="com.adc.da.sys.entity.MenuEO">
|
||||
SELECT <include refid="Base_Column_List"/> FROM TS_MENU M LEFT JOIN TS_ROLE_MENU RM ON M.ID = RM.MENU_ID where RM.ROLE_ID = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectPersonalByUserId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
TS_MENU.name
|
||||
from TS_MENU
|
||||
left join TS_ROLE_MENU on TS_MENU.id = TS_ROLE_MENU.menu_id
|
||||
left join TS_USER_ROLE on TS_USER_ROLE.ROLE_ID=TS_ROLE_MENU.ROLE_ID
|
||||
left join TS_USER on TS_USER_ROLE.USER_ID=TS_USER.USID
|
||||
where TS_MENU.valid_flag=0 and TS_MENU.parent_id='ZY9RFA4M35'
|
||||
and TS_USER.USID=#{value}
|
||||
</select>
|
||||
|
||||
<select id="queryByAllMenu" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,733 @@
|
||||
<?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.sys.dao.OrgEODao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
<result column="org_desc" property="orgDesc"/>
|
||||
<result column="org_code" property="orgCode"/>
|
||||
<result column="org_type" property="orgType"/>
|
||||
<result column="parent_id" property="pId"/>
|
||||
<result column="parent_ids" property="parentIds"/>
|
||||
<result column="is_show" property="isShow"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="shot_name" property="shotName"/>
|
||||
<!--liwenxuan:-->
|
||||
<result column="userName" property="userName"/>
|
||||
<result column="usId" property="usId"/>
|
||||
<result column="roleId" property="roleId"/>
|
||||
<result column="roleName" property="roleName"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap id="SSOResultMap" type="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="sso_id" property="ssoId"/>
|
||||
<result column="sso_org_id" property="ssoOrgId"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
<result column="org_desc" property="orgDesc"/>
|
||||
<result column="org_code" property="orgCode"/>
|
||||
<result column="org_type" property="orgType"/>
|
||||
<result column="parent_id" property="pId"/>
|
||||
<result column="parent_ids" property="parentIds"/>
|
||||
<result column="is_show" property="isShow"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="shot_name" property="shotName"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="SSO_Column_List">
|
||||
id, valid_flag, org_name, org_desc,org_code,parent_id, parent_ids, is_show, remarks,shot_name,sso_id,sso_org_id,creation_time,modify_time
|
||||
</sql>
|
||||
|
||||
<!-- TS_ORG table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
TS_ORG.id, TS_ORG.valid_flag, TS_ORG.org_name, TS_ORG.org_desc,TS_ORG.org_code,TS_ORG.parent_id, TS_ORG.parent_ids, TS_ORG.is_show, TS_ORG.remarks,TS_ORG.shot_name
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_Lista">
|
||||
TS_ORG.id, TS_ORG.valid_flag, TS_ORG.org_name, TS_ORG.org_desc,TS_ORG.org_code,TS_ORG.parent_id, TS_ORG.parent_ids, TS_ORG.is_show, TS_ORG.remarks,TS_ORG.shot_name,TS_ORG.org_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="orgName != null">
|
||||
and org_name ${nameOperator} #{orgName}
|
||||
</if>
|
||||
<if test="orgDesc != null">
|
||||
and org_desc ${orgDescOperator} #{orgDesc}
|
||||
</if>
|
||||
<if test="orgCode != null">
|
||||
and org_code ${orgCodeOperator} #{orgCode}
|
||||
</if>
|
||||
<if test="orgType != null">
|
||||
and org_type ${orgTypeOperator} #{orgType}
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
and parent_id ${parentIdOperator} #{pId}
|
||||
</if>
|
||||
<if test="parentIds != null">
|
||||
and parent_ids ${parentIdsOperator} #{parentIds}
|
||||
</if>
|
||||
<if test="isShow != null">
|
||||
and is_show ${isShowOperator} #{isShow}
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
and remarks ${remarksOperator} #{remarks}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<update id="deleteLogic" parameterType="java.lang.String">
|
||||
update TS_ORG
|
||||
set valid_flag = 1
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 组织机构 -->
|
||||
<update id="updateOrgOfSSOById" parameterType="com.adc.da.sys.entity.OrgEO">
|
||||
update TS_ORG
|
||||
<set>
|
||||
<if test="validFlag != null">
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
<if test="orgName != null">
|
||||
org_name = #{orgName},
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
parent_id = #{pId},
|
||||
</if>
|
||||
<if test="parentIds != null">
|
||||
parent_ids = #{parentIds},
|
||||
</if>
|
||||
<if test="orgDesc != null">
|
||||
org_desc = #{orgDesc},
|
||||
</if>
|
||||
<if test="orgCode != null">
|
||||
org_code = #{orgCode},
|
||||
</if>
|
||||
<if test="orgType != null">
|
||||
org_type = #{orgType},
|
||||
</if>
|
||||
<if test="isShow != null">
|
||||
is_show = #{isShow},
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
remarks = #{remarks},
|
||||
</if>
|
||||
<if test="shotName != null">
|
||||
shot_name = #{shotName},
|
||||
</if>
|
||||
<if test="ssoId != null">
|
||||
sso_id = #{ssoId}
|
||||
</if>
|
||||
<if test="ssoOrgId != null">
|
||||
sso_org_id = #{ssoOrgId}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据id查询 组织机构 -->
|
||||
<select id="getOrgEOById" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_Lista"/>
|
||||
from TS_ORG
|
||||
where id = #{id} and valid_flag=0
|
||||
</select>
|
||||
|
||||
<!-- 根据SSOOrgId查询 组织机构 -->
|
||||
<select id="getOrgInfoBySSOOrgId" resultMap="SSOResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="SSO_Column_List"/>
|
||||
from TS_ORG
|
||||
where sso_org_id = #{SSOOrgId}
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:添加了判断-->
|
||||
<select id="getOrgEOByNameAndPid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
WHERE 1=1
|
||||
<if test="orgName != null">
|
||||
AND org_name = #{orgName}
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
AND parent_id = #{pId}
|
||||
</if>
|
||||
and valid_flag = 0
|
||||
|
||||
</select>
|
||||
<!--liwenxuan:添加了入参-->
|
||||
<select id="getOrgEOByPid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG WHERE
|
||||
parent_id = #{pId} AND valid_flag = 0
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:判断组织机构名不重复-->
|
||||
<select id="getOrgEOByorgNameAndPidAndId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
WHERE 1=1
|
||||
<if test="orgName != null">
|
||||
AND org_name = #{orgName}
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
AND parent_id = #{pId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
and valid_flag = 0
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:判断组织机构简称不重复-->
|
||||
<select id="getOrgEOByShotNameAndPidAndId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
WHERE 1=1
|
||||
<if test="shotName != null">
|
||||
AND shot_name = #{shotName}
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
AND parent_id = #{pId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
and valid_flag = 0
|
||||
</select>
|
||||
<select id="queryOrgByList" resultMap="BaseResultMap" >
|
||||
select <include refid="Base_Column_List"/> from TS_ORG
|
||||
WHERE ORG_NAME = #{orgName} AND VALID_FLAG =0
|
||||
</select>
|
||||
|
||||
<select id="listOrgEOByOrgName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
,TS_DICTYPE.DIC_TYPE_NAME AS org_type FROM
|
||||
(SELECT
|
||||
<include refid="Base_Column_Lista"/>
|
||||
FROM TS_ORG right join (
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM TS_ORG
|
||||
WHERE TS_ORG.valid_flag !=1
|
||||
<if test="orgName != null">
|
||||
AND TS_ORG.ORG_NAME LIKE '%${orgName}%'
|
||||
</if>
|
||||
) b on TS_ORG.id=b.id
|
||||
<if test="orgName != null">
|
||||
or b.parent_ids like '%'||TS_ORG.id||'%'
|
||||
</if>
|
||||
)
|
||||
TS_ORG
|
||||
left join TS_DICTYPE on TS_ORG.ORG_TYPE = TS_DICTYPE.id
|
||||
WHERE TS_ORG.valid_flag !=1
|
||||
ORDER BY TS_ORG.modify_time DESC
|
||||
</select>
|
||||
<!--liwenuxan:获取所有节点-->
|
||||
<select id="selectOrgAllNode" resultMap="BaseResultMap">
|
||||
SELECT id, org_name, parent_id,parent_ids,shot_name, org_desc,
|
||||
org_code, org_type, is_show,remarks FROM TS_ORG WHERE valid_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="getChildDept" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
id, org_name, parent_id,parent_ids,shot_name, org_desc,
|
||||
org_code, org_type, is_show,remarks
|
||||
FROM
|
||||
TS_ORG START WITH "ID" = #{orgId} CONNECT BY PARENT_ID = PRIOR "ID"
|
||||
AND VALID_FLAG = 0
|
||||
</select>
|
||||
|
||||
<select id="selectRootNode" resultMap="BaseResultMap" parameterType="java.util.LinkedList">
|
||||
SELECT id, org_name, parent_id, is_show,shot_name FROM TS_ORG WHERE valid_flag = 0 AND parent_id IS NULL
|
||||
</select>
|
||||
|
||||
<select id="selectNodeByPid" resultMap="BaseResultMap" parameterType="java.util.LinkedList">
|
||||
SELECT id, org_name, parent_id,shot_name, org_desc,
|
||||
org_code, org_type, is_show FROM TS_ORG WHERE valid_flag = 0 and parent_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryByObject" resultMap="BaseResultMap" parameterType="com.adc.da.sys.entity.OrgEO">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
<delete id="delOrgRelatedUser" parameterType="com.adc.da.sys.entity.UserOrgEO">
|
||||
DELETE FROM TS_USER_ORG WHERE USER_ID = #{userId} AND ORG_ID = #{orgId}
|
||||
</delete>
|
||||
<delete id="delOrgRelatedUserByUserId" parameterType="java.lang.String">
|
||||
DELETE FROM TS_USER_ORG WHERE USER_ID = #{usId}
|
||||
</delete>
|
||||
|
||||
<insert id="addOrgRelatedUsers" parameterType="java.util.List">
|
||||
insert into TS_USER_ORG
|
||||
(
|
||||
user_id,
|
||||
org_id
|
||||
) SELECT A.*
|
||||
FROM (
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
#{item.userId,jdbcType=VARCHAR},
|
||||
#{item.orgId,jdbcType=VARCHAR}
|
||||
FROM DUAL
|
||||
</foreach>
|
||||
)A
|
||||
</insert>
|
||||
<insert id="addOrgRelatedUser" parameterType="com.adc.da.sys.entity.UserEO">
|
||||
insert into TS_USER_ORG
|
||||
(user_id,org_id)
|
||||
values
|
||||
(#{userId,jdbcType=VARCHAR},
|
||||
#{orgId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<update id="updateUserOrg" parameterType="com.adc.da.sys.entity.UserOrgEO">
|
||||
update TS_USER_ORG
|
||||
set org_id = #{orgId}
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<!--liwenxuan:根据组织机构id删除组织机构和用户关联关系-->
|
||||
<delete id="deleteUserOrgByOrgId" parameterType="java.lang.String">
|
||||
DELETE FROM TS_USER_ORG WHERE ORG_ID = #{orgId}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getOrgListOfSSO" resultMap="SSOResultMap">
|
||||
SELECT
|
||||
<include refid="SSO_Column_List"/>
|
||||
FROM TS_ORG
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="addOrgOfSSO" parameterType="com.adc.da.sys.entity.OrgEO">
|
||||
insert into TS_ORG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="validFlag != null">valid_flag,</if>
|
||||
<if test="orgName != null">org_name,</if>
|
||||
<if test="orgDesc != null">org_desc,</if>
|
||||
<if test="orgCode != null">org_code,</if>
|
||||
<if test="orgType != null">org_type,</if>
|
||||
<if test="pId != null">parent_id,</if>
|
||||
<if test="parentIds != null">parent_ids,</if>
|
||||
<if test="isShow != null">is_show,</if>
|
||||
<if test="remarks != null">remarks,</if>
|
||||
<if test="creationTime != null">creation_time,</if>
|
||||
<if test="modifyTime != null">modify_time,</if>
|
||||
<if test="shotName != null">shot_name,</if>
|
||||
<if test="ssoId != null">sso_id</if>,
|
||||
<if test="ssoOrgId != null">sso_org_id</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="orgName != null">#{orgName},</if>
|
||||
<if test="orgDesc != null">#{orgDesc},</if>
|
||||
<if test="orgCode != null">#{orgCode},</if>
|
||||
<if test="orgType != null">#{orgType},</if>
|
||||
<if test="pId != null">#{pId},</if>
|
||||
<if test="parentIds != null">#{parentIds},</if>
|
||||
<if test="isShow != null">#{isShow},</if>
|
||||
<if test="remarks != null">#{remarks},</if>
|
||||
<if test="creationTime != null">#{creationTime},</if>
|
||||
<if test="modifyTime != null">#{modifyTime},</if>
|
||||
<if test="shotName != null">#{shotName},</if>
|
||||
<if test="ssoOrgId != null">#{ssoOrgId}</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 修改记录,只修改不为空的字段 -->
|
||||
<update id="updateOrgOfSSO" parameterType="com.adc.da.sys.entity.OrgEO">
|
||||
update TS_ORG
|
||||
<set>
|
||||
<if test="validFlag != null">
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
<if test="orgName != null">
|
||||
org_name = #{orgName},
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
parent_id = #{pId},
|
||||
</if>
|
||||
<if test="parentIds != null">
|
||||
parent_ids = #{parentIds},
|
||||
</if>
|
||||
<if test="orgDesc != null">
|
||||
org_desc = #{orgDesc},
|
||||
</if>
|
||||
<if test="orgCode != null">
|
||||
org_code = #{orgCode},
|
||||
</if>
|
||||
<if test="orgType != null">
|
||||
org_type = #{orgType},
|
||||
</if>
|
||||
<if test="isShow != null">
|
||||
is_show = #{isShow},
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
remarks = #{remarks},
|
||||
</if>
|
||||
<if test="shotName != null">
|
||||
shot_name = #{shotName},
|
||||
</if>
|
||||
<if test="modifyTime != null">
|
||||
modify_time = #{modifyTime},
|
||||
</if>
|
||||
<if test="ssoId != null">
|
||||
sso_id = #{ssoId},
|
||||
</if>
|
||||
<if test="ssoOrgId != null">
|
||||
sso_org_id = #{ssoOrgId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!--根据角色名称获取组织结构用户树-->
|
||||
<!--liwenxuan:根据角色名称,查找该角色的用户(用于流程中心)-->
|
||||
<select id="getTreeByRole1" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
tu.uname as userName,tu.usid as id,tg.id as pId,tg.org_name as orgName
|
||||
FROM TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg.id = tuo.org_id
|
||||
WHERE
|
||||
tr. NAME = #{roleName}
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.DISABLE_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:根据用户查找其组织结构,筛选出唯一的组织结构-->
|
||||
<select id="getTreeByRole2" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
tg.id,tg.org_name,tg.parent_id as pId
|
||||
FROM
|
||||
TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg.id = tuo.org_id
|
||||
WHERE
|
||||
tr. NAME = #{roleName}
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND TU.DISABLE_FLAG = '0'
|
||||
GROUP BY tg.id,tg.org_name,tg.parent_id
|
||||
</select>
|
||||
|
||||
<!--根据用户获取其所在组织结构下某个角色的用户-->
|
||||
<!--liwenxuan:1.查找该用户所在的组织结构,拿到parent_ids-->
|
||||
<select id="getLeaderByUserId1" parameterType="java.lang.String" resultType="com.adc.da.sys.entity.OrgEO">
|
||||
SELECT
|
||||
tg2.id,tg2.parent_ids AS parentIds,tg2.org_type as orgType,tg2.org_name as orgName
|
||||
FROM
|
||||
TS_ORG tg2
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG2.ID = tuo.org_id
|
||||
WHERE tuo.user_id = #{usId} and tg2.VALID_FLAG ='0'
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:2.根据第一步返回的parent_ids,和id 组成list ,使用in查询,筛选组织结构-->
|
||||
<select id="getLeaderByUserId2" resultType="java.lang.String">
|
||||
SELECT
|
||||
TG.id
|
||||
FROM
|
||||
TS_ORG tg
|
||||
WHERE 1=1
|
||||
<if test="orgType != null">
|
||||
AND TG.ORG_TYPE = #{orgType}
|
||||
</if>
|
||||
AND tg.id IN
|
||||
<if test="parentIds!=null">
|
||||
<foreach collection="parentIds" item="item" index="index" open="(" separator="," close=")" >
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and tg.VALID_FLAG='0'
|
||||
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:3.根据2中获取的id,和角色名称roleName删选用户-->
|
||||
<select id="getLeaderByUserId3" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
TU.usid,tu.uname as userName
|
||||
FROM
|
||||
TS_ORG tg
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG.ID = TUO.ORG_ID
|
||||
LEFT JOIN TS_USER tu ON tu.usid = tuo.user_Id
|
||||
LEFT JOIN TS_USER_ROLE tur on tur.User_Id = tu.usid
|
||||
LEFT JOIN TS_ROLE tro ON tro. ID = tur.role_id
|
||||
WHERE
|
||||
tro. NAME = #{roleName}
|
||||
AND (TG.PARENT_IDS LIKE '%${id}%' or TG.id = #{id})
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.VALID_FLAG = '0'
|
||||
AND tro.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<!--根据orgId查找所有组织结构-->
|
||||
<select id="getAllOrgbyOrgId" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select TS_ORG.id,TS_ORG.org_name,TS_ORG.parent_ids,TS_ORG.org_Type from TS_ORG WHERE TS_ORG.id = #{orgId}
|
||||
and TS_ORG.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
|
||||
<!--liwenxuan:根据角色名称和部门id获取组织结构用户树-->
|
||||
<!--liwenxuan:1.根据角色名称和部门id获取组织结构用户树 :向下查找组织结构-->
|
||||
<select id="getTreeByRoleAndOrgId1" resultType="java.lang.String">
|
||||
select TS_ORG.id from TS_ORG WHERE TS_ORG.parent_ids LIKE '%${orgId}%' and TS_ORG.VALID_FLAG = '0'
|
||||
</select>
|
||||
<!--liwenxuan:2.根据parentIds获取所有组织机构树-->
|
||||
<select id="getTreeByRoleAndOrgId2" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/> from TS_ORG where TS_ORG.id IN
|
||||
<if test="ids != null">
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and TS_ORG.VALID_FLAG = '0'
|
||||
</select>
|
||||
<!--liwenxuan:3.根据组织机构和角色获取其下所有用户-->
|
||||
<select id="getTreeByRoleAndOrgId3" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
tu.uname AS userName,
|
||||
tu.usid AS usId,
|
||||
tg. ID AS pId,
|
||||
tu.usid AS id,
|
||||
tg.org_name AS orgName,
|
||||
tr. ID AS roleId,
|
||||
tr. NAME AS roleName
|
||||
FROM
|
||||
TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg. ID = tuo.org_id
|
||||
WHERE
|
||||
tr. NAME = #{roleName}
|
||||
|
||||
<foreach item="tsOrg" collection="orgEOList" index="index" open="AND tg. ID IN (" close=")" separator=",">
|
||||
#{tsOrg.id}
|
||||
</foreach>
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND TU.DISABLE_FLAG = '0'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getManagerByOrgId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
tu.uname AS userName,
|
||||
tu.usid AS usId,
|
||||
tg. ID AS pId,
|
||||
tu.usid AS id,
|
||||
tg.org_name AS orgName,
|
||||
tr. ID AS roleId,
|
||||
tr. NAME AS roleName
|
||||
FROM
|
||||
TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg. ID = tuo.org_id
|
||||
WHERE
|
||||
tr. NAME = #{roleName}
|
||||
AND tg. ID = #{orgId}
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND TU.DISABLE_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<!--根据orgType查询查询部及以上组织结构-->
|
||||
<select id="getIdsByorgType" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/> from TS_ORG where (org_type='DEPART'
|
||||
OR org_name = '广汽研究院') AND VALID_FLAG = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getIdByName" resultMap="BaseResultMap">
|
||||
select * from TS_ORG where org_name = #{orgName}
|
||||
and TS_ORG.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!--liwenxuan:1.根据orgId,roleId查看用户-->
|
||||
<select id="getLeaderByOrgIdAndRoleId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
TU.usid,tu.uname as userName
|
||||
FROM
|
||||
TS_ORG tg
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG.ID = TUO.ORG_ID
|
||||
LEFT JOIN TS_USER tu ON tu.usid = tuo.user_Id
|
||||
LEFT JOIN TS_USER_ROLE tur on tur.User_Id = tu.usid
|
||||
LEFT JOIN TS_ROLE tro ON tro. ID = tur.role_id
|
||||
WHERE
|
||||
(tur.role_id = 'YK5P33FZ29TPN2VPDP6E' or tur.role_id = 'GQSBB2N3KURYYC6AUFER')
|
||||
<foreach item="item" collection="orgIds" index="index" open="AND tuo.org_Id IN (" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.VALID_FLAG = '0'
|
||||
AND tro.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
|
||||
<!--liwenxuan:根据orgIds查询下面的用户集合-->
|
||||
<select id="getLeaderByUserId4" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
TU.usid,tu.uname as userName
|
||||
FROM
|
||||
TS_ORG tg
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG.ID = TUO.ORG_ID
|
||||
LEFT JOIN TS_USER tu ON tu.usid = tuo.user_Id
|
||||
LEFT JOIN TS_USER_ROLE tur on tur.User_Id = tu.usid
|
||||
LEFT JOIN TS_ROLE tro ON tro. ID = tur.role_id
|
||||
WHERE 1 = 1 AND (
|
||||
<foreach collection="id" item="item" separator="or" index="index">
|
||||
(TG.PARENT_IDS LIKE '%${item}%' or TG.id = #{item})
|
||||
</foreach>
|
||||
)
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.VALID_FLAG = '0'
|
||||
AND tro.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<!--根据orgId和roleId确定是否有一个用户 科级负责人:YK5P33FZ29TPN2VPDP6E-->
|
||||
<select id="getHeadOfSection" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
TU.usid,tu.uname as userName
|
||||
FROM
|
||||
TS_ORG tg
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG.ID = TUO.ORG_ID
|
||||
LEFT JOIN TS_USER tu ON tu.usid = tuo.user_Id
|
||||
LEFT JOIN TS_USER_ROLE tur on tur.User_Id = tu.usid
|
||||
LEFT JOIN TS_ROLE tro ON tro. ID = tur.role_id
|
||||
WHERE
|
||||
tur.role_id = 'YK5P33FZ29TPN2VPDP6E' AND tuo.org_Id = #{orgId}
|
||||
<if test="userId !=null and userId !=''">
|
||||
AND tu.USID != #{userId}
|
||||
</if>
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.VALID_FLAG = '0'
|
||||
AND tro.VALID_FLAG = '0'
|
||||
</select>
|
||||
<!---->
|
||||
<!--根据orgId和roleId确定是否有一个用户 部门负责人:GQSBB2N3KURYYC6AUFER-->
|
||||
<select id="getDepartmentHeads" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
TU.usid,tu.uname as userName
|
||||
FROM
|
||||
TS_ORG tg
|
||||
LEFT JOIN TS_USER_ORG tuo ON TG.ID = TUO.ORG_ID
|
||||
LEFT JOIN TS_USER tu ON tu.usid = tuo.user_Id
|
||||
LEFT JOIN TS_USER_ROLE tur on tur.User_Id = tu.usid
|
||||
LEFT JOIN TS_ROLE tro ON tro. ID = tur.role_id
|
||||
WHERE
|
||||
tur.role_id = 'GQSBB2N3KURYYC6AUFER' AND tuo.org_Id = #{orgId}
|
||||
<if test="userId !=null and userId !=''">
|
||||
AND tu.USID != #{userId}
|
||||
</if>
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.VALID_FLAG = '0'
|
||||
AND tro.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<select id="getTreeByRole4" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
tg.id,tg.org_name,tg.parent_id as pId
|
||||
FROM
|
||||
TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg.id = tuo.org_id
|
||||
WHERE
|
||||
tr.id = #{roleId}
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND TU.DISABLE_FLAG = '0'
|
||||
GROUP BY tg.id,tg.org_name,tg.parent_id
|
||||
</select>
|
||||
|
||||
<select id="getTreeByRole3" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
tu.uname as userName,tu.usid as id,tg.id as pId,tg.org_name as orgName
|
||||
FROM TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON tu.usid = tur.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tg ON tg.id = tuo.org_id
|
||||
WHERE
|
||||
tr.id = #{roleId}
|
||||
AND TU.VALID_FLAG = '0'
|
||||
AND TR.VALID_FLAG = '0'
|
||||
AND tg.VALID_FLAG = '0'
|
||||
AND tu.DISABLE_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<select id="getOrgInfoByOrgId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
where id = #{value}
|
||||
and VALID_FLAG = '0'
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getOrgParentInfoOrgId" resultMap="BaseResultMap" parameterType="com.adc.da.sys.entity.OrgEO">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_ORG
|
||||
where id in
|
||||
<foreach collection="parentIdsList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and VALID_FLAG = '0'
|
||||
and ORG_TYPE = 'SUBUS'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getOrgRootTree" resultMap="BaseResultMap" >
|
||||
select <include refid="Base_Column_List"/> from TS_ORG
|
||||
WHERE 1=1
|
||||
AND VALID_FLAG =0
|
||||
AND ORG_TYPE = 'SUBUS'
|
||||
AND parent_id IS NOT NULL
|
||||
AND parent_idS IS NOT NULL
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,253 @@
|
||||
<?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.sys.dao.RoleEODao">
|
||||
<!-- Result Map -->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.RoleEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
<result column="is_default" property="isDefault" />
|
||||
<result column="name" property="name" />
|
||||
<result column="remarks" property="remarks" />
|
||||
<result column="ext_info" property="extInfo" />
|
||||
<result column="use_flag" property="useFlag"/>
|
||||
<result column="oper_user" property="operUser"/>
|
||||
<result column="role_type" property="roleType" />
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleMenuMap" extends="BaseResultMap" type="com.adc.da.sys.entity.RoleEO">
|
||||
<collection property="menuEOList" ofType="com.adc.da.sys.entity.MenuEO">
|
||||
<id column="m_id" property="id" />
|
||||
<result column="m_validFlag" property="validFlag" />
|
||||
<result column="m_name" property="name" />
|
||||
<result column="m_parentId" property="parentId" />
|
||||
<result column="m_parentIds" property="parentIds" />
|
||||
<result column="m_href" property="href" />
|
||||
<result column="m_icon" property="icon" />
|
||||
<result column="m_isShow" property="isShow" />
|
||||
<result column="m_permission" property="permission" />
|
||||
<result column="m_remarks" property="remarks" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_ROLE table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
id, valid_flag,role_type, is_default, name, remarks, ext_info,use_flag,oper_user,creation_time,modify_time
|
||||
</sql>
|
||||
|
||||
<sql id="Role_Menu_List">
|
||||
r.*, m.id as m_id,
|
||||
m.valid_flag as m_validFlag,
|
||||
m.name as m_name,
|
||||
m.parent_id as m_parentId,
|
||||
m.parent_ids as m_parentIds,
|
||||
m.href as m_href,
|
||||
m.icon as m_icon,
|
||||
m.is_show as m_isShow,
|
||||
m.permission as m_permission,
|
||||
m.remarks as m_remarks
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="roleType != null" >
|
||||
and role_type ${roleTypeOperator} #{roleType}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
and is_default ${isDefaultOperator} #{isDefault}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and name ${nameOperator} #{name}
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
and remarks ${remarksOperator} #{remarks}
|
||||
</if>
|
||||
<if test="useFlag !=null">
|
||||
and use_flag = #{useFlag}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<update id="save" parameterType="com.adc.da.sys.entity.RoleEO">
|
||||
<selectKey resultType="java.lang.Integer" keyProperty="usid" order="BEFORE">
|
||||
select SEQ_TS_ROLE.nextval as idfrom dual
|
||||
</selectKey>
|
||||
update TS_ROLE
|
||||
set `valid_flag`= 0
|
||||
where `id` = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getRoleWithMenus" resultMap="RoleMenuMap" parameterType="java.lang.String">
|
||||
select <include refid="Role_Menu_List" />
|
||||
from TS_ROLE r
|
||||
left join TS_ROLE_MENU rm on r.id = rm.role_id
|
||||
left join TS_MENU m on rm.menu_id = m.id
|
||||
where r.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getRoleListByUserId" resultMap="BaseResultMap"
|
||||
parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from TS_ROLE r, TS_USER_ROLE ur
|
||||
where r.id = ur.role_id and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="findByUserId" resultMap="BaseResultMap"
|
||||
parameterType="java.lang.String">
|
||||
select r.id, r.name
|
||||
from TS_ROLE r
|
||||
LEFT JOIN TS_USER_ROLE ur ON r.id = ur.role_id
|
||||
where ur.user_id = #{userId} and r.valid_flag = 0
|
||||
</select>
|
||||
|
||||
<update id="deleteLogic" parameterType="java.lang.String">
|
||||
update TS_ROLE
|
||||
set valid_flag = 1
|
||||
where id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRoleMenuByRoleId" parameterType="java.lang.String">
|
||||
delete from TS_ROLE_MENU rm
|
||||
where rm.role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<resultMap id="UserRoleMap" type="com.adc.da.sys.entity.UserRoleEO">
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="role_id" property="roleId" />
|
||||
</resultMap>
|
||||
<select id="getUserRoleListByRoleId" resultMap="UserRoleMap" parameterType="java.lang.String">
|
||||
select * from TS_USER_ROLE ur
|
||||
where ur.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap" parameterType="com.adc.da.sys.vo.RoleVO">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from TS_ROLE
|
||||
where valid_flag = 0 AND use_flag=0
|
||||
<if test="extInfo != null and extInfo != '' ">
|
||||
and ext_info = #{extInfo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMenuIdListByRoleId" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
select menu_id
|
||||
from TS_ROLE_MENU rm
|
||||
where rm.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<insert id="saveRoleMenu">
|
||||
insert into TS_ROLE_MENU(role_id,menu_id) values (#{roleId}, #{menuId})
|
||||
</insert>
|
||||
|
||||
<select id="isBelong" resultType="integer">
|
||||
select count(1)
|
||||
from TS_USER_ROLE
|
||||
where user_id = #{userId} and role_id =#{roleId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- liwenxuan:根据角色名称查询 TS_ROLE -->
|
||||
<select id="selectByNameAndId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from TS_ROLE
|
||||
where 1=1
|
||||
<if test="name !=null">
|
||||
and TS_ROLE.name = #{name}
|
||||
</if>
|
||||
<if test="id !=null">
|
||||
and TS_ROLE.id != #{id}
|
||||
</if>
|
||||
and valid_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- TS_ROLE 列表总数 -->
|
||||
<select id="queryByCount" resultType="java.lang.Integer"
|
||||
parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_ROLE
|
||||
<include refid="Base_Where_Clause" />
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_ROLE列表 -->
|
||||
<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 TS_ROLE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex}) a
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_ROLE
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:根据角色id判断此角色对应的用户数量 roleId:N9XXK39BQUW9NE44THB6为标准采购员 JAW56N9JBR9ATDU47UZG为部门总师 9AFR6XUPPGWGUWF5AP59为分管院领导-->
|
||||
<select id="countByRoleId" resultType="java.lang.Integer">
|
||||
select count(ts_user_role.ROLE_ID) from ts_role LEFT JOIN ts_user_role ON ts_role.id = ts_user_role.role_id
|
||||
WHERE (ts_user_role.ROLE_ID = 'N9XXK39BQUW9NE44THB6' OR ts_user_role.ROLE_ID = 'JAW56N9JBR9ATDU47UZG' OR ts_user_role.ROLE_ID = '9AFR6XUPPGWGUWF5AP59') AND ts_user_role.ROLE_ID =#{roleId}
|
||||
<if test="userId != null and userId !='' ">
|
||||
AND ts_user_role.user_id !=#{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:根据角色id判断此角色对应的用户数量 roleId:GQSBB2N3KURYYC6AUFER和YK5P33FZ29TPN2VPDP6E为部门负责人和科级负责人-->
|
||||
<select id="countByRoleIdOfDepartmentAndSection" parameterType="java.lang.String" resultType="java.lang.Integer" >
|
||||
select count(ts_user_role.ROLE_ID) from ts_role LEFT JOIN ts_user_role ON ts_role.id = ts_user_role.role_id
|
||||
WHERE (ts_user_role.ROLE_ID = 'GQSBB2N3KURYYC6AUFER' or ts_user_role.ROLE_ID = 'YK5P33FZ29TPN2VPDP6E') AND ts_user_role.ROLE_ID =#{roleId}
|
||||
</select>
|
||||
|
||||
<!--liwenxuan:所在组织组织机构下科级负责人和部门负责人的个数-->
|
||||
<!--<select id="countByOrgId" parameterType="java.lang.String" resultType="int">
|
||||
select count(*)
|
||||
FROM TS_USER u
|
||||
left join TS_USER_ROLE ur on u.usid = ur.user_id
|
||||
left join TS_ROLE r on ur.role_id = r.id
|
||||
left join TS_USER_ORG UORG on u.usid = UORG.user_id
|
||||
left join TS_ORG ORG on UORG.org_id = ORG.id
|
||||
WHERE (ur.ROLE_ID = 'YK5P33FZ29TPN2VPDP6E' OR ur.ROLE_ID = 'GQSBB2N3KURYYC6AUFER')
|
||||
AND UORG.org_id = #{orgId}
|
||||
</select>-->
|
||||
|
||||
<!--是否为科级负责人-->
|
||||
<select id="querySectionCount" parameterType="java.lang.String" resultType="int">
|
||||
SELECT count(1) FROM TS_ROLE
|
||||
WHERE TS_ROLE.id = 'YK5P33FZ29TPN2VPDP6E' AND TS_ROLE.id = #{roleId}
|
||||
</select>
|
||||
<!--是否为部门负责人-->
|
||||
<select id="querySectionCount1" parameterType="java.lang.String" resultType="int">
|
||||
SELECT count(1) FROM TS_ROLE
|
||||
WHERE TS_ROLE.id = 'GQSBB2N3KURYYC6AUFER' AND TS_ROLE.id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectIdByNames" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
select id from TS_ROLE
|
||||
where valid_flag = 0 and TS_ROLE.name in
|
||||
<foreach collection="nameList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.sys.dao.RoleSarMenuEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.RoleSarMenuEO" >
|
||||
<id column="role_id" property="roleId" />
|
||||
<result column="sar_menu_id" property="sarMenuId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_ROLE_SAR_MENU table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
role_id, sar_menu_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="roleId != null" >
|
||||
and role_id ${roleIdOperator} #{roleId}
|
||||
</if>
|
||||
<if test="sarMenuId != null" >
|
||||
and sar_menu_id ${sarMenuIdOperator} #{sarMenuId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<insert id="insertSubMenu" parameterType="com.adc.da.sys.entity.RoleSarMenuEO" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="role_id">
|
||||
SELECT SEQ_TS_ROLE_SAR_MENU.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into TS_ROLE_SAR_SUB_MENU(<include refid="Base_Column_List" />)
|
||||
values (#{roleId, jdbcType=VARCHAR}, #{sarMenuId, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- TS_ROLE_SAR_MENU 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_ROLE_SAR_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_ROLE_SAR_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 TS_ROLE_SAR_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_ROLE_SAR_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findRoleSarMenu" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List"/> from TS_ROLE_SAR_MENU
|
||||
WHERE role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="queryBusinessStandRootId" resultType="java.lang.String" parameterType="java.lang.String" >
|
||||
select id FROM SAR_MENU WHERE SOR_DIVIDE =#{sorDivide} and PARENT_ID is null and VALID_FLAG = 0
|
||||
</select>
|
||||
|
||||
<select id="selectSarMenuRoots" resultType="com.adc.da.sys.entity.RoleSarMenuEO" >
|
||||
select sm.id,sm.PARENT_ID as parentId ,sm.MENU_NAME as menuName,sm.SOR_DIVIDE as sorDivide from SAR_MENU sm WHERE sm.PARENT_ID IS NULL
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.sys.dao.UserConfigEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.UserConfigEO" >
|
||||
<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="config_content" property="configContent" />
|
||||
<result column="config_type" property="configType" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_USER_CONFIG table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
modify_time, creation_time, valid_flag, config_content, config_type, user_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 >= #{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="configContent != null" >
|
||||
and config_content ${configContentOperator} #{configContent}
|
||||
</if>
|
||||
<if test="configType != null" >
|
||||
and config_type ${configTypeOperator} #{configType}
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- TS_USER_CONFIG 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_USER_CONFIG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_USER_CONFIG列表 -->
|
||||
<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 TS_USER_CONFIG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_USER_CONFIG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,615 @@
|
||||
<?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.sys.dao.UserEODao">
|
||||
<!-- Result Map -->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.UserEO">
|
||||
<id column="usid" property="usid"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="uname" property="uname"/>
|
||||
<result column="r_extInfo" property="extInfo"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="work_num" property="workNum"/>
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="role_name" property="roleName"/>
|
||||
<result column="org_id" property="orgId"/>
|
||||
<result column="org_type" property="orgType"/>
|
||||
<result column="oper_user" property="operUser"/>
|
||||
<result column="user_source" property="userSource"/>
|
||||
<result column="disable_flag" property="disableFlag"/>
|
||||
<result column="unlock_flag" property="unlockFlag"/>
|
||||
<result column="mobile_phone" property="mobilePhone"/>
|
||||
<result column="office_phone" property="officePhone"/>
|
||||
<result column="ADDRESS" property="address"/>
|
||||
<result column="FAX_ADDRESS" property="faxAddress"/>
|
||||
<result column="userInfoId" property="userInfoId"/>
|
||||
<result column="role_id" property="roleId"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SSOResultMap" type="com.adc.da.sys.entity.UserEO">
|
||||
<id column="usid" property="usid"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="valid_flag" property="validFlag"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="uname" property="uname"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="work_num" property="workNum"/>
|
||||
<result column="creation_time" property="creationTime"/>
|
||||
<result column="modify_time" property="modifyTime"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="user_source" property="userSource"/>
|
||||
<result column="disable_flag" property="disableFlag"/>
|
||||
<result column="unlock_flag" property="unlockFlag"/>
|
||||
<result column="sso_id" property="ssoId" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="UserRoleMap" extends="BaseResultMap" type="com.adc.da.sys.entity.UserEO">
|
||||
<collection property="roleEOList" ofType="com.adc.da.sys.entity.RoleEO">
|
||||
<id column="id" property="id"/>
|
||||
<!--<result column="data_scope" property="dataScope" />-->
|
||||
<result column="r_validFlag" property="validFlag"/>
|
||||
<result column="is_default" property="isDefault"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="ext_Info" property="extInfo"/>
|
||||
<result column="use_flag" property="useFlag"/>
|
||||
<result column="isDefault" property="isDefault"/>
|
||||
<!--r.is_default as isDefault-->
|
||||
</collection>
|
||||
<collection property="orgEOList" ofType="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="org_id" property="id"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
<result column="org_desc" property="orgDesc"/>
|
||||
<result column="org_code" property="orgCode"/>
|
||||
<result column="org_type" property="orgType"/>
|
||||
<!--<result column="org_parent_id" property="parentId" />-->
|
||||
<result column="org_remarks" property="remarks"/>
|
||||
<result column="org_isshow" property="isShow"/>
|
||||
<result column="org_validFlag" property="validFlag"/>
|
||||
<result column="org_parentIds" property="parentIds"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!--liwenxuan:oper_user,user_source这两个字段为数据库新加的字段-->
|
||||
<!-- TS_USER table all fields -->
|
||||
<sql id="Base_Column_List">
|
||||
usid, account, valid_flag, password, uname, ext_info,email,work_num,creation_time,modify_time,oper_user,user_source,disable_flag,unlock_flag,user_type
|
||||
</sql>
|
||||
|
||||
<sql id="SSO_Column_List">
|
||||
usid, account, valid_flag, password, uname, ext_info,email,work_num,creation_time,modify_time,oper_user,user_source,disable_flag,unlock_flag,user_type,sso_id
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 获取用户组织机构及角色信息 -->
|
||||
<sql id="User_Role_List">
|
||||
u.*, r.id as id,
|
||||
r.valid_flag as r_validFlag,
|
||||
r.is_default as isDefault,
|
||||
r.name as name,
|
||||
r.remarks as remarks,
|
||||
r.ext_info as r_extInfo,
|
||||
r.is_default as isDefault,
|
||||
ORG.id AS org_id,
|
||||
ORG.ORG_NAME AS org_name,
|
||||
ORG.ORG_DESC AS org_desc,
|
||||
ORG.ORG_CODE AS org_code,
|
||||
ORG.ORG_TYPE AS org_type,
|
||||
ORG.PARENT_ID AS org_parent_id,
|
||||
ORG.REMARKS AS org_remarks,
|
||||
ORG.IS_SHOW AS org_isshow,
|
||||
ORG.valid_flag AS org_validFlag,
|
||||
ORG.PARENT_IDS AS org_parentIds
|
||||
</sql>
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="usid != null">
|
||||
and usid ${usidOperator} #{usid}
|
||||
</if>
|
||||
<if test="account != null">
|
||||
and account ${accountOperator} #{account}
|
||||
</if>
|
||||
<if test="password != null">
|
||||
and password ${passwordOperator} #{password}
|
||||
</if>
|
||||
<if test="uname != null">
|
||||
and uname ${unameOperator} #{uname}
|
||||
</if>
|
||||
<if test="workNum != null">
|
||||
and work_num ${workNumOperator} #{workNum}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="disableFlag != null">
|
||||
and disable_flag ${disableFlagOperator} #{disableFlag}
|
||||
</if>
|
||||
<if test="unlockFlag != null">
|
||||
and unlock_flag ${unlockFlagOperator} #{unlockFlag}
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
and user_type ${userTypeOperator} #{userType}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<!-- 查询条件 (不让管理员显示出来 TU.usid != 'WY8J26MH23')-->
|
||||
<sql id="Base_Where_Clause_2">
|
||||
where 1=1 AND TU.valid_flag=0
|
||||
<trim suffixOverrides="and">
|
||||
<if test="usid != null">
|
||||
and TU.usid ${usidOperator} #{usid}
|
||||
</if>
|
||||
<if test="account != null">
|
||||
and TU.account like concat(concat('%',#{account}),'%')
|
||||
</if>
|
||||
<if test="password != null">
|
||||
and TU.password ${passwordOperator} #{password}
|
||||
</if>
|
||||
<if test="uname != null">
|
||||
and TU.uname ${unameOperator} concat(concat('%',#{uname}),'%')
|
||||
</if>
|
||||
<if test="workNum != null">
|
||||
and TU.work_num ${workNumOperator} ${workNum}
|
||||
</if>
|
||||
<if test="validFlag != null">
|
||||
and TU.valid_flag ${validFlagOperator} #{validFlag}
|
||||
</if>
|
||||
<if test="disableFlag != null">
|
||||
and TU.disable_flag ${disableFlagOperator} #{disableFlag}
|
||||
</if>
|
||||
<if test="unlockFlag != null">
|
||||
and TU.unlock_flag ${unlockFlagOperator} #{unlockFlag}
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
and TU.user_type ${userTypeOperator} #{userType}
|
||||
</if>
|
||||
<if test="orgId != null">
|
||||
and TUO.ORG_ID ${orgIdOperator} #{orgId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and TUR.role_ID ${roleIdOperator} #{roleId}
|
||||
</if>
|
||||
<if test="roleName != null">
|
||||
and tr.name ${roleNameOperator} #{roleName}
|
||||
</if>
|
||||
<if test = "disAdmin">
|
||||
and TU.usid != 'WY8J26MH23'
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<!-- 修改用户密码 -->
|
||||
<update id="updatePassword">
|
||||
update TS_USER
|
||||
<set>
|
||||
password = #{newPassword}
|
||||
</set>
|
||||
where usid = #{usid}
|
||||
</update>
|
||||
|
||||
<update id="updateUserEO" parameterType="com.adc.da.sys.entity.UserEO">
|
||||
update TS_USER
|
||||
<set>
|
||||
uname = #{uname}
|
||||
</set>
|
||||
where usid = #{usid}
|
||||
</update>
|
||||
<!-- 根据用户ID获取角色ID列表 -->
|
||||
<select id="getRoleIdListByUserId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select role_id
|
||||
from TS_USER_ROLE ur
|
||||
where ur.user_id = #{usid}
|
||||
</select>
|
||||
<!-- 保存用户角色 -->
|
||||
<insert id="saveUserRole">
|
||||
insert into TS_USER_ROLE(user_id,role_id) values (#{usid}, #{roleId})
|
||||
</insert>
|
||||
<!-- 保存用户组织机构 -->
|
||||
<insert id="saveUserOrg">
|
||||
insert into TS_USER_ORG(user_id,org_id) values (#{usid}, #{orgId})
|
||||
</insert>
|
||||
<!-- 删除用户角色关联关系 -->
|
||||
<delete id="deleteUserRoleByUsid" parameterType="java.lang.String">
|
||||
delete from
|
||||
TS_USER_ROLE
|
||||
where user_id = #{usid}
|
||||
</delete>
|
||||
<!-- 删除用户组织机构关系 -->
|
||||
<delete id="deleteUserOrgByUsid" parameterType="java.lang.String">
|
||||
delete from
|
||||
TS_USER_ORG
|
||||
where user_id = #{usid}
|
||||
</delete>
|
||||
<!-- 批量删除用户信息 -->
|
||||
<update id="deleteLogicInBatch" parameterType="java.util.List">
|
||||
update TS_USER
|
||||
set valid_flag = 1
|
||||
where usid in
|
||||
<foreach item="usid" collection="list" open="(" separator=","
|
||||
close=")" index="index">
|
||||
#{usid}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 批量删除用户与角色关联关系 -->
|
||||
<delete id="deleteUserRoleByUsidInBatch" parameterType="java.util.List">
|
||||
delete from TS_USER_ROLE
|
||||
where user_id in
|
||||
<foreach item="usid" collection="list" open="(" separator=","
|
||||
close=")" index="index">
|
||||
#{usid}
|
||||
</foreach>
|
||||
</delete>
|
||||
<!-- 批量删除用户与组织机构关联关系 -->
|
||||
<delete id="deleteUserOrgByUsidInBatch" parameterType="java.util.List">
|
||||
delete from TS_USER_ORG
|
||||
where user_id in
|
||||
<foreach item="usid" collection="list" open="(" separator=","
|
||||
close=")" index="index">
|
||||
#{usid}
|
||||
</foreach>
|
||||
</delete>
|
||||
<!-- 根据账户获取用户信息 -->
|
||||
<select id="getUserEOByAccount" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_USER
|
||||
where account = #{account}
|
||||
AND valid_flag=0
|
||||
<if test="usid != null">
|
||||
AND usid !=#{usid}
|
||||
</if>
|
||||
</select>
|
||||
<!-- 根据用户ID获取用户信息及角色、组织机构信息 -->
|
||||
<select id="getUserWithRoles" resultMap="UserRoleMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="User_Role_List"/>
|
||||
from TS_USER u
|
||||
left join TS_USER_ROLE ur on u.usid = ur.user_id
|
||||
left join TS_ROLE r on ur.role_id = r.id
|
||||
left join TS_USER_ORG UORG on u.usid = UORG.user_id
|
||||
left join TS_ORG ORG on UORG.org_id = ORG.id
|
||||
where u.usid = #{id} and u.DISABLE_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<select id="getUserWithRolesAll" resultMap="UserRoleMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="User_Role_List"/>
|
||||
from TS_USER u
|
||||
left join TS_USER_ROLE ur on u.usid = ur.user_id
|
||||
left join TS_ROLE r on ur.role_id = r.id
|
||||
left join TS_USER_ORG UORG on u.usid = UORG.user_id
|
||||
left join TS_ORG ORG on UORG.org_id = ORG.id
|
||||
where u.usid = #{id} and u.VALID_FLAG = '0'
|
||||
</select>
|
||||
|
||||
<!-- 根据角色ID获取所有用户 -->
|
||||
<select id="get" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_USER u
|
||||
left join TS_USER_ROLE ur
|
||||
on u.usid = ur.role_id
|
||||
where ur.role_Id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 重置密码 -->
|
||||
<update id="updatePasswordByPrimaryKey" parameterType="com.adc.da.sys.entity.UserEO">
|
||||
update TS_USER
|
||||
set
|
||||
password = #{password}
|
||||
where usid = #{usid}
|
||||
</update>
|
||||
|
||||
<!-- TS_USER 列表总数 -->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(usid) from TS_USER
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_USER列表 -->
|
||||
<select id="queryByPage" resultMap="UserRoleMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM(
|
||||
SELECT
|
||||
tmp_user.*, ROWNUM rn
|
||||
FROM(
|
||||
SELECT * FROM TS_USER
|
||||
<include refid="Base_Where_Clause"/>
|
||||
) tmp_user
|
||||
WHERE
|
||||
ROWNUM <= ${pager.endIndex}
|
||||
)
|
||||
WHERE
|
||||
rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<!-- 用户管理列表总数 -->
|
||||
<select id="queryUserInfoByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT count(distinct tu.usid)
|
||||
FROM
|
||||
TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON TU.USID = TUR.USER_ID
|
||||
LEFT JOIN TS_USER_INFO tui ON tu.usid = tui.user_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tu.usid = tuo.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_ORG tor ON tor. ID = tuo.org_id
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询用户管理列表 -->
|
||||
<select id="queryUserInfoByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT * FROM(
|
||||
SELECT temp_user.*, ROWNUM rn
|
||||
FROM(
|
||||
SELECT TEMP.* FROM (
|
||||
SELECT
|
||||
TU.usid,max(TU.USER_TYPE) as USER_TYPE,max(TU."ACCOUNT") as ACCOUNT,MAX(TU.UNAME) AS UNAME,MAX(TU.EMAIL) AS
|
||||
EMAIL,MAX(TU.WORK_NUM) AS WORK_NUM,
|
||||
MAX(TU.DISABLE_FLAG) AS DISABLE_FLAG,MAX(tu.modify_time) AS modify_time,MAX(tr."NAME") AS
|
||||
ROLE_NAME,MAX(tui.mobile_phone)AS mobile_phone,
|
||||
MAX(tui.office_phone) AS office_phone,MAX(tui.ADDRESS) AS ADDRESS,MAX(tui.FAX_ADDRESS) AS
|
||||
FAX_ADDRESS,MAX(tor.org_name) AS org_name,
|
||||
MAX(tuo.ORG_ID) AS ORG_ID,
|
||||
MAX(tor.org_type) AS orgType,
|
||||
MAX(tui.ID) AS userInfoId
|
||||
FROM TS_USER tu
|
||||
LEFT JOIN TS_USER_ROLE tur ON TU.USID = TUR.USER_ID
|
||||
LEFT JOIN TS_USER_INFO tui ON tu.usid = tui.user_id
|
||||
LEFT JOIN TS_USER_ORG tuo ON tu.usid = tuo.user_id
|
||||
LEFT JOIN TS_ROLE tr ON tr. ID = tur.role_id
|
||||
LEFT JOIN TS_ORG tor ON (tor. ID = tuo.org_id and tor.VALID_FLAG = 0)
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
GROUP BY tu.usid
|
||||
) TEMP
|
||||
ORDER BY TEMP.modify_time DESC,TEMP.usid
|
||||
) temp_user
|
||||
WHERE ROWNUM <= ${pager.endIndex} ) a
|
||||
WHERE rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据当前登录用户id查询个人信息及部门-->
|
||||
<select id="selectOrgByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
TU.*,ORG.ORG_NAME,ORG.id as orgId
|
||||
FROM
|
||||
TS_USER_ORG TUO
|
||||
LEFT JOIN TS_USER TU ON TUO.USER_ID = TU.USID
|
||||
LEFT JOIN TS_ORG ORG ON ORG.ID=TUO.ORG_ID
|
||||
WHERE TUO.USER_ID =#{value} AND TU.VALID_FLAG=0
|
||||
</select>
|
||||
|
||||
<!--根据当前登录用户id查询它所对应的组织机构的个数-->
|
||||
<select id="selectOrgCountByPrimaryKey" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM
|
||||
TS_USER_ORG TUO
|
||||
WHERE TUO.USER_ID =#{value}
|
||||
</select>
|
||||
|
||||
<!--根据当前登录用户id查询个人角色信息-->
|
||||
<select id="selectRoleMessageByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
TU.*,TR.NAME role_name
|
||||
FROM
|
||||
TS_USER_ROLE TUR
|
||||
LEFT JOIN TS_USER TU ON TU.USID = TUR.USER_ID
|
||||
LEFT JOIN TS_ROLE TR ON TR. ID = TUR.ROLE_ID
|
||||
WHERE TUR.USER_ID =#{value} AND TU.VALID_FLAG=0
|
||||
</select>
|
||||
|
||||
<!-- 根据 orgid 查询用户 -->
|
||||
<select id="queryByOrgCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT
|
||||
COUNT(TU.USID)
|
||||
FROM
|
||||
TS_USER_ORG TUO
|
||||
LEFT JOIN TS_USER TU ON TU.USID = TUO.USER_ID
|
||||
LEFT JOIN TS_USER_ROLE TUR ON TU.USID = TUR.USER_ID
|
||||
LEFT JOIN TS_ROLE TR ON TR.ID=TUR.ROLE_ID
|
||||
LEFT JOIN TS_ORG ORG ON ORG.ID=TUO.ORG_ID
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
</select>
|
||||
<select id="queryByOrg" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT * FROM (
|
||||
SELECT TMP_USER.*,ROWNUM RN FROM (
|
||||
SELECT
|
||||
TU.*,TR.NAME ROLE_NAME,ORG.ORG_NAME
|
||||
FROM
|
||||
TS_USER_ORG TUO
|
||||
LEFT JOIN TS_USER TU ON TU.USID = TUO.USER_ID
|
||||
LEFT JOIN TS_USER_ROLE TUR ON TU.USID = TUR.USER_ID
|
||||
LEFT JOIN TS_ROLE TR ON TR.ID=TUR.ROLE_ID
|
||||
LEFT JOIN TS_ORG ORG ON ORG.ID=TUO.ORG_ID
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
) TMP_USER
|
||||
WHERE ROWNUM <= ${pager.endIndex}
|
||||
) WHERE RN >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据原始密码修改密码 -->
|
||||
<select id="selectByUnameAndPwd" resultMap="BaseResultMap"
|
||||
parameterType="com.adc.da.sys.entity.UserEO">
|
||||
select TS_USER.password
|
||||
from TS_USER
|
||||
where valid_flag = 0 and account = #{account}
|
||||
</select>
|
||||
|
||||
<!--查找未分配组织结构的用户的行数-->
|
||||
<select id="findBySetOrgCount" resultType="java.lang.Integer"
|
||||
parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT count(DISTINCT(tu.usid))
|
||||
FROM TS_USER tu
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_USER_ROLE tur ON TU.USID = TUR.USER_ID
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
and tuo.user_id is null
|
||||
</select>
|
||||
|
||||
<!--查询所有未分配组织结构的用户-->
|
||||
<select id="findBySetOrg" resultMap="BaseResultMap"
|
||||
parameterType="com.adc.da.base.page.BasePage">
|
||||
SELECT * FROM
|
||||
(SELECT tmp_tb.* , rownum rn FROM
|
||||
(SELECT DISTINCT TU.*,
|
||||
tui.mobile_phone AS mobile_phone,
|
||||
tui.office_phone AS office_phone,tui.ADDRESS AS ADDRESS,tui.FAX_ADDRESS AS FAX_ADDRESS,
|
||||
tor.org_Name,
|
||||
tor.ORG_TYPE
|
||||
FROM TS_USER tu
|
||||
LEFT JOIN TS_USER_ORG tuo ON tuo.user_id = tu.usid
|
||||
LEFT JOIN TS_ORG tor ON tor.id = tuo.org_id
|
||||
LEFT JOIN TS_USER_INFO tui ON tu.usid = tui.user_id
|
||||
LEFT JOIN TS_USER_ROLE tur ON TU.USID = TUR.USER_ID
|
||||
<include refid="Base_Where_Clause_2"/>
|
||||
and tuo.user_id is null
|
||||
order by tu.modify_time desc
|
||||
) tmp_tb WHERE rownum <= ${pager.endIndex}
|
||||
) a
|
||||
WHERE rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectThatOrgUser" resultType="java.lang.String"
|
||||
parameterType="java.lang.String">
|
||||
SELECT USER_ID
|
||||
FROM TS_USER_ORG tuo
|
||||
WHERE tuo.ORG_ID = #{orgId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectOrgByUserId" resultType="java.lang.String"
|
||||
parameterType="java.lang.String">
|
||||
SELECT ORG_ID
|
||||
FROM TS_USER_ORG tuo
|
||||
WHERE tuo.USER_ID = #{userId}
|
||||
</select>
|
||||
<!--syt:查询所有用户信息-->
|
||||
<select id="queryUserEoList" resultMap="BaseResultMap" parameterType="com.adc.da.sys.page.UserEOPage">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM TS_USER
|
||||
<include refid="Base_Where_Clause"/>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="addSSOUser" parameterType="com.adc.da.sys.entity.UserEO">
|
||||
insert into TS_USER
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="usid != null">usid,</if>
|
||||
<if test="account != null">account,</if>
|
||||
<if test="validFlag != null">valid_flag,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="uname != null">uname,</if>
|
||||
<if test="extInfo != null">ext_info,</if>
|
||||
<if test="email !=null">email,</if>
|
||||
<if test="workNum != null">work_num,</if>
|
||||
<if test="creationTime !=null">creation_time,</if>
|
||||
<if test="modifyTime !=null">modify_time,</if>
|
||||
<if test="operUser !=null">oper_user,</if>
|
||||
<if test="userSource !=null">user_source,</if>
|
||||
<if test="disableFlag !=null">disable_flag,</if>
|
||||
<if test="unlockFlag !=null">unlock_flag,</if>
|
||||
<if test="userType !=null">user_type,</if>
|
||||
<if test="ssoId != null" >sso_id</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="usid != null">#{usid},</if>
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="uname != null">#{uname},</if>
|
||||
<if test="extInfo != null">#{extInfo},</if>
|
||||
<if test="email !=null">#{email},</if>
|
||||
<if test="workNum != null">#{workNum},</if>
|
||||
<if test="creationTime !=null">#{creationTime},</if>
|
||||
<if test="modifyTime !=null">#{modifyTime},</if>
|
||||
<if test="operUser !=null">#{operUser},</if>
|
||||
<if test="userSource !=null">#{userSource},</if>
|
||||
<if test="disableFlag !=null">#{disableFlag},</if>
|
||||
<if test="unlockFlag !=null">#{unlockFlag},</if>
|
||||
<if test="userType !=null">#{userType},</if>
|
||||
<if test="ssoId !=null">#{ssoId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getUserBySSOId" resultMap="SSOResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM TS_USER
|
||||
WHERE sso_id = #{value}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectUserByWorkNum" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
SELECT
|
||||
<include refid="SSO_Column_List"/>
|
||||
FROM TS_USER
|
||||
WHERE WORK_NUM = #{value}
|
||||
</select>
|
||||
|
||||
<select id="selectAllUserInfoBySSO" resultMap="BaseResultMap" >
|
||||
SELECT
|
||||
<include refid="SSO_Column_List"/>
|
||||
FROM TS_USER
|
||||
WHERE user_source ='SSO' AND VALID_FLAG = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据角色名称获取所有用户 -->
|
||||
<select id="getUserListByRoleName" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
u.usid,u.uname,ur.role_id
|
||||
from TS_USER u
|
||||
left join TS_USER_ROLE ur ON u.usid = ur.user_id
|
||||
left join ts_role tr ON ur.role_id = tr.id
|
||||
where tr.name = #{roleName} and
|
||||
u.valid_flag = 0 and tr.valid_flag = 0
|
||||
</select>
|
||||
<!-- 根据角色id获取所有用户 -->
|
||||
<select id="getUserListByUserId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
u.usid,u.uname,ur.role_id,ur.name
|
||||
from TS_USER u
|
||||
left join TS_USER_ROLE ur ON u.usid = ur.user_id
|
||||
left join ts_role tr ON ur.role_id = tr.id
|
||||
where tr.id = #{id} and
|
||||
u.valid_flag = 0 and tr.valid_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="getUserEOBySpecRole" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
TS_USER.*
|
||||
from TS_USER left join TS_USER_ORG on TS_USER.USID=TS_USER_ORG.USER_ID
|
||||
left join TS_USER_ROLE on TS_USER.USID=TS_USER_ROLE.USER_ID
|
||||
left join TS_ROLE on TS_USER_ROLE.ROLE_ID=TS_ROLE.ID
|
||||
where TS_USER.VALID_FLAG=0
|
||||
and TS_ROLE.NAME='部门负责人'
|
||||
and TS_USER_ORG.ORG_ID = #{orgId}
|
||||
and TS_USER.USID != #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getOrgIdByUserId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
*
|
||||
from TS_USER_ORG
|
||||
where USER_ID=#{value}
|
||||
</select>
|
||||
|
||||
<!-- 根据account获取未逻辑删除的UserEO -->
|
||||
<select id="getUserEOByAccountNotDeleted" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_USER where account = #{account} and VALID_FLAG != 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,233 @@
|
||||
<?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.sys.dao.UserInfoEODao">
|
||||
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.UserInfoEO">
|
||||
<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="signature" property="signature"/>
|
||||
<result column="fax_address" property="faxAddress"/>
|
||||
<result column="address" property="address"/>
|
||||
<result column="gender" property="gender"/>
|
||||
<result column="part_post" property="partPost"/>
|
||||
<result column="assistant_post" property="assistantPost"/>
|
||||
<result column="main_post" property="mainPost"/>
|
||||
<result column="mobile_phone" property="mobilePhone"/>
|
||||
<result column="office_phone" property="officePhone"/>
|
||||
<result column="user_pic" property="userPic"/>
|
||||
<result column="duty" property="duty"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="uname" property="uName"/>
|
||||
<result column="configType" property="configType"/>
|
||||
<result column="configContent" property="configContent"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- TS_DICTYPE table all fields ,account,uname(liwenxuan:这两个字段加上会报错) -->
|
||||
<sql id="Base_Column_List">
|
||||
modify_time, creation_time, valid_flag, signature, fax_address, address, gender, part_post, assistant_post, main_post, mobile_phone,
|
||||
office_phone, user_pic, duty, user_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 >= #{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="signature != null">
|
||||
and signature ${signatureOperator} #{signature}
|
||||
</if>
|
||||
<if test="faxAddress != null">
|
||||
and fax_address ${faxAddressOperator} #{faxAddress}
|
||||
</if>
|
||||
<if test="address != null">
|
||||
and address ${addressOperator} #{address}
|
||||
</if>
|
||||
<if test="gender != null">
|
||||
and gender ${genderOperator} #{gender}
|
||||
</if>
|
||||
<if test="partPost != null">
|
||||
and part_post ${partPostOperator} #{partPost}
|
||||
</if>
|
||||
<if test="assistantPost != null">
|
||||
and assistant_post ${assistantPostOperator} #{assistantPost}
|
||||
</if>
|
||||
<if test="mainPost != null">
|
||||
and main_post ${mainPostOperator} #{mainPost}
|
||||
</if>
|
||||
<if test="mobilePhone != null">
|
||||
and mobile_phone ${mobilePhoneOperator} #{mobilePhone}
|
||||
</if>
|
||||
<if test="officePhone != null">
|
||||
and office_phone ${officePhoneOperator} #{officePhone}
|
||||
</if>
|
||||
<if test="userPic != null">
|
||||
and user_pic ${userPicOperator} #{userPic}
|
||||
</if>
|
||||
<if test="duty != null">
|
||||
and duty ${dutyOperator} #{duty}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- liwenxuan:根据用户id修改用户详细信息-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.sys.entity.UserInfoEO">
|
||||
update TS_USER_INFO
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<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= "signature!=null">
|
||||
signature = #{signature},
|
||||
</if>
|
||||
<if test= "faxAddress!=null">
|
||||
fax_address = #{faxAddress},
|
||||
</if>
|
||||
<if test= "address!=null">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test= "gender!=null">
|
||||
gender = #{gender},
|
||||
</if>
|
||||
<if test= "partPost!=null">
|
||||
part_post = #{partPost},
|
||||
</if>
|
||||
<if test= "assistantPost!=null">
|
||||
assistant_post = #{assistantPost},
|
||||
</if>
|
||||
<if test="mainPost !=null">
|
||||
main_post = #{mainPost},
|
||||
</if>
|
||||
<if test="mobilePhone !=null">
|
||||
mobile_phone = #{mobilePhone},
|
||||
</if>
|
||||
<if test="officePhone !=null">
|
||||
office_phone = #{officePhone},
|
||||
</if>
|
||||
<if test="userPic !=null">
|
||||
user_pic = #{userPic},
|
||||
</if>
|
||||
<if test="duty !=null">
|
||||
duty = #{duty},
|
||||
</if>
|
||||
<if test="userId !=null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 查找用户信息-->
|
||||
<select id="getUserInfoByUserId" resultMap="BaseResultMap" parameterType="com.adc.da.sys.entity.UserInfoEO">
|
||||
select
|
||||
tui.modify_time, tui.creation_time, tui.valid_flag,
|
||||
tui.signature, tui.fax_address, tui.address,
|
||||
tui.gender, tui.part_post, tui.assistant_post, tui.main_post,
|
||||
tui.mobile_phone, tui.office_phone, tui.user_pic, tui.duty,
|
||||
tui.user_id, tui.id ,tu.account,tu.uName,tu.email,TS_ORG.org_name as orgName,TS_USER_CONFIG.CONFIG_TYPE as configType,
|
||||
TS_USER_CONFIG.CONFIG_CONTENT as configContent
|
||||
from TS_USER_INFO tui
|
||||
left join TS_USER tu ON tui.USER_ID = tu.USID
|
||||
left join TS_USER_ORG on TS_USER_ORG.USER_ID = tui.USER_ID
|
||||
left join TS_ORG on TS_USER_ORG.ORG_ID = TS_ORG.id
|
||||
left join TS_USER_CONFIG on tu.USID = TS_USER_CONFIG.USER_ID and TS_USER_CONFIG.CONFIG_TYPE = 'PAGE_SIZE'
|
||||
where tui.user_id = #{userId} AND tui.valid_flag =0
|
||||
<if test="configType != null and configType != '' ">
|
||||
and TS_USER_CONFIG.CONFIG_TYPE = #{configType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- TS_USER_INFO 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_USER_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_USER_INFO列表 -->
|
||||
<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 TS_USER_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from TS_USER_INFO
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''">
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 个人信息保存修改-->
|
||||
<update id="updateByUserId" parameterType="com.adc.da.sys.entity.UserInfoEO">
|
||||
update TS_USER_INFO
|
||||
set
|
||||
<if test="faxAddress == null or faxAddress == ''">
|
||||
fax_address = '',
|
||||
</if>
|
||||
<if test="officePhone == null or officePhone == ''">
|
||||
office_phone = '',
|
||||
</if>
|
||||
<if test="faxAddress != null and faxAddress != ''">
|
||||
fax_address=#{faxAddress},
|
||||
</if>
|
||||
<if test="officePhone != null and officePhone != ''">
|
||||
office_phone=#{officePhone},
|
||||
</if>
|
||||
mobile_phone=#{mobilePhone},
|
||||
signature=#{signature,jdbcType=VARCHAR},
|
||||
user_pic=#{userPic,jdbcType=VARCHAR},
|
||||
valid_flag=0
|
||||
where user_id=#{userId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.sys.dao.UserRoleEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.UserRoleEO" >
|
||||
<id column="user_id" property="userId" />
|
||||
<result column="role_id" property="roleId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_USER_ROLE table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
user_id, role_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="userId != null" >
|
||||
and `user_id` ${userIdOperator} #{userId}
|
||||
</if>
|
||||
<if test="roleId != null" >
|
||||
and `role_id` ${roleIdOperator} #{roleId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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.sys.dao.WarnTimeEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.WarnTimeEO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="warn_type" property="warnType" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TS_WARN_TIME table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
id, warn_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
and id ${idOperator} #{id}
|
||||
</if>
|
||||
<if test="warnType != null" >
|
||||
and warn_type ${warnTypeOperator} #{warnType}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- TS_WARN_TIME 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TS_WARN_TIME
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TS_WARN_TIME列表 -->
|
||||
<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 TS_WARN_TIME
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TS_WARN_TIME
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user