TAttaInfoMapper.xml 4.23 KB
Newer Older
fangxinjiang's avatar
fangxinjiang 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper">
      <resultMap id="tAttaInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo">
            <id property="id" column="id"/>
            <result property="attaName" column="atta_name"/>
            <result property="attaSrc" column="atta_src"/>
            <result property="attaSize" column="atta_size"/>
            <result property="attaType" column="atta_type"/>
            <result property="createUser" column="create_user"/>
            <result property="createTime" column="create_time"/>
            <result property="relationType" column="relation_type"/>
            <result property="domainId" column="domain_id"/>
      </resultMap>
      <sql id="Base_Column_List">
                 a.id,
                      a.atta_name,
                      a.atta_src,
                      a.atta_size,
                      a.atta_type,
                      a.create_user,
                      a.create_time,
                      a.relation_type,
                      a.domain_id
      </sql>
      <sql id="tAttaInfo_where">
            <if test="tAttaInfo != null">
                <if test="tAttaInfo.id != null and tAttaInfo.id.trim() != ''">
                    AND a.id = #{tAttaInfo.id}
                </if>
                <if test="tAttaInfo.attaName != null and tAttaInfo.attaName.trim() != ''">
                    AND a.atta_name = #{tAttaInfo.attaName}
                </if>
                <if test="tAttaInfo.attaSrc != null and tAttaInfo.attaSrc.trim() != ''">
                    AND a.atta_src = #{tAttaInfo.attaSrc}
                </if>
                <if test="tAttaInfo.attaSize != null">
                    AND a.atta_size = #{tAttaInfo.attaSize}
                </if>
                <if test="tAttaInfo.attaType != null and tAttaInfo.attaType.trim() != ''">
                    AND a.atta_type = #{tAttaInfo.attaType}
                </if>
                <if test="tAttaInfo.createUser != null and tAttaInfo.createUser.trim() != ''">
                    AND a.create_user = #{tAttaInfo.createUser}
                </if>
                <if test="tAttaInfo.createTime != null">
                    AND a.create_time = #{tAttaInfo.createTime}
                </if>
                <if test="tAttaInfo.relationType != null and tAttaInfo.relationType.trim() != ''">
                    AND a.relation_type = #{tAttaInfo.relationType}
                </if>
                <if test="tAttaInfo.domainId != null and tAttaInfo.domainId.trim() != ''">
                    AND a.domain_id = #{tAttaInfo.domainId}
                </if>
            </if>
      </sql>
    <!--tAttaInfo简单分页查询-->
    <select id="getTAttaInfoPage" resultMap="tAttaInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_atta_info a
        <where>
            1=1
            <include refid="tAttaInfo_where"/>
        </where>
    </select>

    <!--tAttaInfo 获取list-->
    <select id="getTAttaInfoList" resultMap="tAttaInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_atta_info a
        <where>
            1=1
            <include refid="tAttaInfo_where"/>
        </where>
    </select>
    <select id="getKeenAtta" resultMap="tAttaInfoMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_atta_info a
        <where>
            1=1
            <if test="values != null and values.size() > 0">
                and  a.domain_id in
                <foreach collection="values" item="param" index="index" open="(" close=")" separator=",">
                    #{param}
                </foreach>
            </if>
            and a.create_time >= #{dayStart}
            and a.relation_type in ("3","4")
        </where>
    </select>
95 96 97 98 99 100 101 102 103 104 105 106 107 108

	<update id="updateDomainId">
		update t_atta_info
		<trim prefix="set" suffixOverrides=",">
			domain_id=#{domainId}
		</trim>
		WHERE
		<if test="ids != null and ids.size() > 0">
			id in
			<foreach collection="ids" item="param" index="index" open="(" close=")" separator=",">
				#{param}
			</foreach>
		</if>
	</update>
fangxinjiang's avatar
fangxinjiang committed
109
</mapper>