You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ry_zhky/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml

168 lines
9.2 KiB

<?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.ruoyi.system.mapper.TdPropertyManagerMapper">
<resultMap type="TdPropertyManager" id="TdPropertyManagerResult">
<result property="useId" column="use_id" />
<result property="useDepart" column="use_depart" />
<result property="userName" column="user_name" />
<result property="useDate" column="use_date" />
<result property="frameworkId" column="framework_id" />
<result property="recoverDepart" column="recover_depart" />
<result property="recoverName" column="recover_name" />
<result property="recoverDate" column="recover_date" />
<result property="shemichengdu" column="shemichengdu" />
<result property="part" column="part" />
<result property="areaId" column="area_id" />
<result property="propertyNum" column="property_num" />
<result property="secretsType" column="secrets_type" />
<result property="deptId" column="dept_id" />
</resultMap>
<sql id="selectTdPropertyManagerVo">
select use_id, use_depart, user_name, use_date, framework_id, recover_depart, recover_name, recover_date, shemichengdu, part, area_id, property_num,secrets_type,dept_id from td_property_manager d
</sql>
<select id="selectTdPropertyManagerList" parameterType="TdPropertyManager" resultMap="TdPropertyManagerResult">
<include refid="selectTdPropertyManagerVo"/>
<where>
<if test="useId != null and useId != ''"> and use_id = #{useId}</if>
<if test="useDepart != null and useDepart != ''"> and use_depart = #{useDepart}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="useDate != null "> and use_date = #{useDate}</if>
<if test="frameworkId != null and frameworkId != ''"> and framework_id = #{frameworkId}</if>
<if test="recoverDepart != null and recoverDepart != ''"> and recover_depart = #{recoverDepart}</if>
<if test="recoverName != null and recoverName != ''"> and recover_name like concat('%', #{recoverName}, '%')</if>
<if test="recoverDate != null "> and recover_date = #{recoverDate}</if>
<if test="shemichengdu != null "> and shemichengdu = #{shemichengdu}</if>
<if test="part != null and part != ''"> and part = #{part}</if>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
<if test="propertyNum != null "> and property_num = #{propertyNum}</if>
<if test="secretsType != null and secretsType != '' " > and secrets_type = #{secretsType}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectTdPropertyManagerByUseId" parameterType="String" resultMap="TdPropertyManagerResult">
<include refid="selectTdPropertyManagerVo"/>
where use_id = #{useId}
</select>
<insert id="insertTdPropertyManager" parameterType="TdPropertyManager">
insert into td_property_manager
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="useId != null">use_id,</if>
<if test="useDepart != null">use_depart,</if>
<if test="userName != null">user_name,</if>
<if test="useDate != null">use_date,</if>
<if test="frameworkId != null">framework_id,</if>
<if test="recoverDepart != null">recover_depart,</if>
<if test="recoverName != null">recover_name,</if>
<if test="recoverDate != null">recover_date,</if>
<if test="shemichengdu != null">shemichengdu,</if>
<if test="part != null">part,</if>
<if test="areaId != null">area_id,</if>
<if test="propertyNum != null">property_num,</if>
<if test="secretsType != null">secrets_type,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="useId != null">#{useId},</if>
<if test="useDepart != null">#{useDepart},</if>
<if test="userName != null">#{userName},</if>
<if test="useDate != null">#{useDate},</if>
<if test="frameworkId != null">#{frameworkId},</if>
<if test="recoverDepart != null">#{recoverDepart},</if>
<if test="recoverName != null">#{recoverName},</if>
<if test="recoverDate != null">#{recoverDate},</if>
<if test="shemichengdu != null">#{shemichengdu},</if>
<if test="part != null">#{part},</if>
<if test="areaId != null">#{areaId},</if>
<if test="propertyNum != null">#{propertyNum},</if>
<if test="secretsType != null">#{secretsType},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<update id="updateTdPropertyManager" parameterType="TdPropertyManager">
update td_property_manager
<trim prefix="SET" suffixOverrides=",">
<if test="useDepart != null">use_depart = #{useDepart},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="useDate != null">use_date = #{useDate},</if>
<if test="frameworkId != null">framework_id = #{frameworkId},</if>
<if test="recoverDepart != null">recover_depart = #{recoverDepart},</if>
<if test="recoverName != null">recover_name = #{recoverName},</if>
<if test="recoverDate != null">recover_date = #{recoverDate},</if>
<if test="shemichengdu != null">shemichengdu = #{shemichengdu},</if>
<if test="part != null">part = #{part},</if>
<if test="areaId != null">area_id = #{areaId},</if>
<if test="propertyNum != null">property_num = #{propertyNum},</if>
<if test="secretsType != null">secrets_type = #{secretsType},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
</trim>
where use_id = #{useId}
</update>
<delete id="deleteTdPropertyManagerByUseId" parameterType="String">
delete from td_property_manager where use_id = #{useId}
</delete>
<delete id="deleteTdPropertyManagerByUseIds" parameterType="String">
delete from td_property_manager where use_id in
<foreach item="useId" collection="array" open="(" separator="," close=")">
#{useId}
</foreach>
</delete>
<select id="countMessageMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_info d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND t.recover_date &gt;= #{minDayTime}
AND t.recover_date &lt;= #{maxDayTime}
</select>
<select id="countSecretsMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_ement d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND t.recover_date &gt;= #{minDayTime}
AND t.recover_date &lt;= #{maxDayTime}
</select>
<select id="countDestoryMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_info d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND d.destory_date &gt;= #{minDayTime}
AND d.destory_date &lt;= #{maxDayTime}
and d.destory_state =#{destoryState}
</select>
<select id="countMessageWxMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_info d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND t.recover_date &gt;= #{minDayTime}
AND t.recover_date &lt;= #{maxDayTime}
and d.destory_state is null
</select>
<select id="countSecretsDestoryMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_ement d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND d.destory_date &gt;= #{minDayTime}
AND d.destory_date &lt;= #{maxDayTime}
and d.destory_state =#{destoryState}
</select>
<select id="countSecretsWxMonth" resultType="java.lang.Integer" parameterType="PropertyManagerDTO">
SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_ement d
on t.use_id = d.use_id where t.secrets_type=#{secretsType}
AND t.recover_date &gt;= #{minDayTime}
AND t.recover_date &lt;= #{maxDayTime}
and d.destory_state is null
</select>
</mapper>