TSocialfundHouseResMapper.xml 5.16 KB
Newer Older
huyuchen's avatar
huyuchen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialfundHouseResMapper">

  <resultMap id="tSocialfundHouseResMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes">
    <id property="id" column="ID"/>
    <result property="userId" column="USER_ID"/>
    <result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
    <result property="fundHousehold" column="FUND_HOUSEHOLD"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="status" column="STATUS"/>
    <result property="userName" column="USER_NAME"/>
    <result property="userDeptName" column="USER_DEPT_NAME"/>
    <result property="houseNameType" column="HOUSE_NAME_TYPE"/>
37
    <result property="authType" column="AUTH_TYPE"/>
huyuchen's avatar
huyuchen committed
38 39 40 41 42 43 44 45 46 47 48
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.USER_ID,
                a.SOCIAL_HOUSEHOLD,
                a.FUND_HOUSEHOLD,
                a.CREATE_TIME,
                a.CREATE_BY,
                a.STATUS,
                a.USER_NAME,
                a.USER_DEPT_NAME,
49 50
                a.HOUSE_NAME_TYPE,
				a.AUTH_TYPE
huyuchen's avatar
huyuchen committed
51 52 53 54 55 56 57 58 59 60 61 62
    </sql>
    <sql id="tSocialfundHouseRes_where">
		<if test="tSocialfundHouseRes != null">
			<if test="tSocialfundHouseRes.idList != null">
				AND a.id in
				<foreach item="idStr" index="index" collection="tSocialfundHouseRes.idList" open="(" separator=","
						 close=")">
					#{idStr}
				</foreach>
			</if>
			<if test="tSocialfundHouseRes.idList == null">
				<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
huyuchen's avatar
huyuchen committed
63
					AND a.SOCIAL_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.socialHousehold},'%')
huyuchen's avatar
huyuchen committed
64 65
				</if>
				<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
huyuchen's avatar
huyuchen committed
66
					AND a.FUND_HOUSEHOLD like concat('%',#{tSocialfundHouseRes.fundHousehold},'%')
huyuchen's avatar
huyuchen committed
67 68 69 70 71
				</if>
				<if test="tSocialfundHouseRes.status != null and tSocialfundHouseRes.status.trim() != ''">
					AND a.STATUS = #{tSocialfundHouseRes.status}
				</if>
				<if test="tSocialfundHouseRes.userName != null and tSocialfundHouseRes.userName.trim() != ''">
huyuchen's avatar
huyuchen committed
72
					AND a.USER_NAME like concat('%',#{tSocialfundHouseRes.userName},'%')
huyuchen's avatar
huyuchen committed
73 74
				</if>
				<if test="tSocialfundHouseRes.userDeptName != null and tSocialfundHouseRes.userDeptName.trim() != ''">
huyuchen's avatar
huyuchen committed
75
					AND a.USER_DEPT_NAME like concat('%',#{tSocialfundHouseRes.userDeptName},'%')
huyuchen's avatar
huyuchen committed
76
				</if>
huyuchen's avatar
huyuchen committed
77 78 79
				<if test="tSocialfundHouseRes.houseNameType != null and tSocialfundHouseRes.houseNameType.trim() != ''">
					AND a.HOUSE_NAME_TYPE = #{tSocialfundHouseRes.houseNameType}
				</if>
80 81 82
				<if test="tSocialfundHouseRes.authType != null and tSocialfundHouseRes.authType.trim() != ''">
					AND a.AUTH_TYPE = #{tSocialfundHouseRes.authType}
				</if>
huyuchen's avatar
huyuchen committed
83 84 85
			</if>
		</if>
    </sql>
huyuchen's avatar
huyuchen committed
86

huyuchen's avatar
huyuchen committed
87 88 89 90 91 92 93 94 95
    <!--tSocialfundHouseRes简单分页查询-->
    <select id="getTSocialfundHouseResPage" resultMap="tSocialfundHouseResMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_socialfund_house_res a
        <where>
            1=1
            <include refid="tSocialfundHouseRes_where"/>
        </where>
huyuchen's avatar
huyuchen committed
96
		order by a.CREATE_TIME desc
huyuchen's avatar
huyuchen committed
97 98 99 100 101
    </select>

	<!--tSocialfundHouseResa导出查询-->
	<select id="getexportList" resultMap="tSocialfundHouseResMap">
		SELECT
huyuchen's avatar
huyuchen committed
102 103 104 105 106 107
		a.SOCIAL_HOUSEHOLD,
		a.FUND_HOUSEHOLD,
		a.STATUS,
		a.USER_NAME,
		a.USER_DEPT_NAME,
		a.HOUSE_NAME_TYPE
huyuchen's avatar
huyuchen committed
108 109 110 111 112 113
		FROM t_socialfund_house_res a
		<where>
			1=1
			<include refid="tSocialfundHouseRes_where"/>
		</where>
	</select>
114 115 116 117 118

	<!-- 删权限 -->
	<delete id="deleteByUserIdAndHuName">
		delete from t_socialfund_house_res where USER_ID = #{tSocialfundHouseRes.userId} and AUTH_TYPE = #{tSocialfundHouseRes.authType}
		<if test="tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''">
hongguangwu's avatar
hongguangwu committed
119
			AND SOCIAL_HOUSEHOLD = #{tSocialfundHouseRes.socialHousehold}
120 121
		</if>
		<if test="tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''">
hongguangwu's avatar
hongguangwu committed
122
			AND FUND_HOUSEHOLD = #{tSocialfundHouseRes.fundHousehold}
123 124 125 126 127 128
		</if>
		<if test="tSocialfundHouseRes.socialHousehold == null and tSocialfundHouseRes.fundHousehold == null">
			AND 1=2
		</if>
	</delete>

huyuchen's avatar
huyuchen committed
129
</mapper>