2021-03-27 14:45:59 +08:00
|
|
|
<?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.tenlion.twoduty.dao.indexgeneral.IIndexGeneralDao">
|
|
|
|
|
|
|
|
<resultMap id="indexGeneralDTO" type="com.tenlion.twoduty.pojo.dtos.indexgeneral.IndexGeneralDTO">
|
|
|
|
<result column="index_general_id" property="indexGeneralId"/>
|
2021-04-16 14:59:42 +08:00
|
|
|
<result column="duty_index_lib_id" property="dutyIndexLibId"/>
|
|
|
|
<result column="duty_index_lib_name" property="dutyIndexLibName"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
<result column="index_general_title" property="indexGeneralTitle"/>
|
|
|
|
<result column="index_general_content" property="indexGeneralContent"/>
|
|
|
|
<result column="index_general_file" property="indexGeneralFile"/>
|
|
|
|
<result column="index_general_image" property="indexGeneralImage"/>
|
2021-04-15 10:50:27 +08:00
|
|
|
<result column="audit_status" property="auditStatus"/>
|
2021-04-15 14:43:16 +08:00
|
|
|
<result column="creator_name" property="creatorName"/>
|
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="indexGeneralBO" type="com.tenlion.twoduty.pojo.bos.indexgeneral.IndexGeneralBO">
|
|
|
|
<result column="index_general_id" property="indexGeneralId"/>
|
2021-04-16 14:59:42 +08:00
|
|
|
<result column="duty_index_lib_id" property="dutyIndexLibId"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
<result column="index_general_title" property="indexGeneralTitle"/>
|
|
|
|
<result column="index_general_content" property="indexGeneralContent"/>
|
|
|
|
<result column="index_general_file" property="indexGeneralFile"/>
|
|
|
|
<result column="index_general_image" property="indexGeneralImage"/>
|
2021-04-15 10:50:27 +08:00
|
|
|
<result column="audit_status" property="auditStatus"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
|
|
<result column="modifier" property="modifier"/>
|
|
|
|
<result column="is_delete" property="isDelete"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="indexGeneralPO" type="com.tenlion.twoduty.pojo.pos.indexgeneral.IndexGeneralPO">
|
|
|
|
<result column="index_general_id" property="indexGeneralId"/>
|
2021-04-16 14:59:42 +08:00
|
|
|
<result column="duty_index_lib_id" property="dutyIndexLibId"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
<result column="index_general_title" property="indexGeneralTitle"/>
|
|
|
|
<result column="index_general_content" property="indexGeneralContent"/>
|
|
|
|
<result column="index_general_file" property="indexGeneralFile"/>
|
|
|
|
<result column="index_general_image" property="indexGeneralImage"/>
|
2021-04-15 10:50:27 +08:00
|
|
|
<result column="audit_status" property="auditStatus"/>
|
2021-03-27 14:45:59 +08:00
|
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
|
|
<result column="creator" property="creator"/>
|
|
|
|
<result column="gmt_modified" property="gmtModified"/>
|
|
|
|
<result column="modifier" property="modifier"/>
|
|
|
|
<result column="is_delete" property="isDelete"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 新增 -->
|
|
|
|
<insert id="save" parameterType="map">
|
|
|
|
INSERT INTO duty_index_general(
|
|
|
|
index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
index_general_title,
|
|
|
|
index_general_content,
|
|
|
|
index_general_file,
|
|
|
|
index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
audit_status,
|
2021-03-27 14:45:59 +08:00
|
|
|
gmt_create,
|
|
|
|
creator,
|
|
|
|
gmt_modified,
|
|
|
|
modifier,
|
|
|
|
is_delete
|
|
|
|
) VALUES(
|
|
|
|
#{indexGeneralId},
|
2021-04-16 14:59:42 +08:00
|
|
|
#{dutyIndexLibId},
|
2021-03-27 14:45:59 +08:00
|
|
|
#{indexGeneralTitle},
|
|
|
|
#{indexGeneralContent},
|
|
|
|
#{indexGeneralFile},
|
|
|
|
#{indexGeneralImage},
|
2021-04-15 10:50:27 +08:00
|
|
|
#{auditStatus},
|
2021-03-27 14:45:59 +08:00
|
|
|
#{gmtCreate},
|
|
|
|
#{creator},
|
|
|
|
#{gmtModified},
|
|
|
|
#{modifier},
|
|
|
|
#{isDelete}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!-- 删除 -->
|
|
|
|
<update id="remove" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
duty_index_general
|
|
|
|
SET
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
modifier = #{modifier},
|
|
|
|
is_delete = 1
|
|
|
|
WHERE
|
|
|
|
index_general_id IN
|
|
|
|
<foreach collection="indexGeneralIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{indexGeneralIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 删除(物理) -->
|
|
|
|
<update id="delete" parameterType="map">
|
|
|
|
DELETE FROM
|
|
|
|
duty_index_general
|
|
|
|
WHERE
|
|
|
|
index_general_id IN
|
|
|
|
<foreach collection="indexGeneralIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{indexGeneralIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 修改 -->
|
|
|
|
<update id="update" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
duty_index_general
|
|
|
|
SET
|
|
|
|
<if test="indexGeneralTitle != null and indexGeneralTitle != ''">
|
|
|
|
index_general_title = #{indexGeneralTitle},
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralContent != null and indexGeneralContent != ''">
|
|
|
|
index_general_content = #{indexGeneralContent},
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralFile != null and indexGeneralFile != ''">
|
|
|
|
index_general_file = #{indexGeneralFile},
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralImage != null and indexGeneralImage != ''">
|
|
|
|
index_general_image = #{indexGeneralImage},
|
|
|
|
</if>
|
2021-04-15 10:50:27 +08:00
|
|
|
<if test="auditStatus != null and auditStatus != ''">
|
|
|
|
audit_status = #{auditStatus},
|
|
|
|
</if>
|
2021-03-27 14:45:59 +08:00
|
|
|
<if test="gmtModified != null and gmtModified != ''">
|
|
|
|
gmt_modified = #{gmtModified},
|
|
|
|
</if>
|
|
|
|
<if test="modifier != null and modifier != ''">
|
|
|
|
modifier = #{modifier}
|
|
|
|
</if>
|
|
|
|
WHERE
|
|
|
|
index_general_id = #{indexGeneralId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 详情 -->
|
|
|
|
<select id="get" parameterType="map" resultMap="indexGeneralDTO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
|
|
|
t1.index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.audit_status,
|
2021-04-15 14:43:16 +08:00
|
|
|
t1.index_general_id,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
2021-04-16 14:59:42 +08:00
|
|
|
t2.index_lib_name duty_index_lib_name
|
2021-03-27 14:45:59 +08:00
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
2021-04-15 14:43:16 +08:00
|
|
|
LEFT JOIN duty_index_lib t2
|
2021-04-16 14:59:42 +08:00
|
|
|
ON t1.duty_index_lib_id = t2.index_lib_id
|
2021-03-27 14:45:59 +08:00
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="indexGeneralId != null and indexGeneralId != ''">
|
|
|
|
AND
|
|
|
|
t1.index_general_id = #{indexGeneralId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 详情 -->
|
|
|
|
<select id="getBO" parameterType="map" resultMap="indexGeneralBO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
|
|
|
t1.index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.audit_status,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="indexGeneralId != null and indexGeneralId != ''">
|
|
|
|
AND
|
|
|
|
t1.index_general_id = #{indexGeneralId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 详情 -->
|
|
|
|
<select id="getPO" parameterType="map" resultMap="indexGeneralPO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
|
|
|
t1.index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.audit_status,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="indexGeneralId != null and indexGeneralId != ''">
|
|
|
|
AND
|
|
|
|
t1.index_general_id = #{indexGeneralId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
<select id="list" parameterType="map" resultMap="indexGeneralDTO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.index_general_image,
|
2021-04-15 14:43:16 +08:00
|
|
|
t1.audit_status,
|
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
2021-04-16 14:59:42 +08:00
|
|
|
t2.index_lib_name duty_index_lib_name
|
2021-03-27 14:45:59 +08:00
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
2021-04-15 14:43:16 +08:00
|
|
|
LEFT JOIN duty_index_lib t2
|
2021-04-16 14:59:42 +08:00
|
|
|
ON t1.duty_index_lib_id = t2.index_lib_id
|
2021-03-27 14:45:59 +08:00
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
2021-04-15 14:43:16 +08:00
|
|
|
t1.index_general_title LIKE CONCAT('%', #{keywords}, '%')
|
2021-03-27 14:45:59 +08:00
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralIds != null and indexGeneralIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.index_general_id IN
|
|
|
|
<foreach collection="indexGeneralIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{indexGeneralIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2021-03-30 18:01:49 +08:00
|
|
|
<if test="indexLibId != null and indexLibId != ''">
|
2021-04-16 14:59:42 +08:00
|
|
|
AND t1.duty_index_lib_id = #{indexLibId}
|
2021-03-30 18:01:49 +08:00
|
|
|
</if>
|
2021-04-15 10:50:27 +08:00
|
|
|
<if test="auditStatus != null and auditStatus != ''">
|
|
|
|
AND t1.audit_status = #{auditStatus}
|
|
|
|
</if>
|
2021-04-16 14:59:42 +08:00
|
|
|
<if test="creator != '1'.toString()">
|
|
|
|
AND t1.creator = #{creator}
|
|
|
|
</if>
|
|
|
|
<!--<if test="data_authority != null and data_authority == 'self'">-->
|
|
|
|
<!--AND t1.creator = #{data_creator}-->
|
|
|
|
<!--</if>-->
|
|
|
|
<!--<if test="data_authority != null and (data_authority == 'department' or data_authority == 'custom')">-->
|
|
|
|
<!--AND t1.creator IN-->
|
|
|
|
<!--<foreach collection="data_creators" index="index" open="(" separator="," close=")">-->
|
|
|
|
<!--#{data_creators[${index}]}-->
|
|
|
|
<!--</foreach>-->
|
|
|
|
<!--</if>-->
|
2021-04-15 14:43:16 +08:00
|
|
|
ORDER BY t1.gmt_create DESC
|
2021-03-27 14:45:59 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
<select id="listBO" parameterType="map" resultMap="indexGeneralBO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
|
|
|
t1.index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.audit_status,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralIds != null and indexGeneralIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.index_general_id IN
|
|
|
|
<foreach collection="indexGeneralIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{indexGeneralIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
<select id="listPO" parameterType="map" resultMap="indexGeneralPO">
|
|
|
|
SELECT
|
|
|
|
t1.index_general_id,
|
2021-04-16 14:59:42 +08:00
|
|
|
t1.duty_index_lib_id,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.index_general_title,
|
|
|
|
t1.index_general_content,
|
|
|
|
t1.index_general_file,
|
|
|
|
t1.index_general_image,
|
2021-04-15 10:50:27 +08:00
|
|
|
t1.audit_status,
|
2021-03-27 14:45:59 +08:00
|
|
|
t1.gmt_create,
|
|
|
|
t1.creator,
|
|
|
|
t1.gmt_modified,
|
|
|
|
t1.modifier,
|
|
|
|
t1.is_delete
|
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
<if test="keywords != null and keywords != ''">
|
|
|
|
AND (
|
|
|
|
<!-- 这里添加其他条件 -->
|
|
|
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
|
|
</if>
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
AND
|
|
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
|
|
</if>
|
|
|
|
<if test="indexGeneralIds != null and indexGeneralIds.size > 0">
|
|
|
|
AND
|
|
|
|
t1.index_general_id IN
|
|
|
|
<foreach collection="indexGeneralIds" index="index" open="(" separator="," close=")">
|
|
|
|
#{indexGeneralIds[${index}]}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 统计 -->
|
|
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
|
|
SELECT
|
|
|
|
COUNT(*)
|
|
|
|
FROM
|
|
|
|
duty_index_general t1
|
|
|
|
WHERE
|
|
|
|
t1.is_delete = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|