feiyu02
2022-06-28 5670e4a15fba292ef5f8fb90e96072de976bb621
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
95
96
97
<?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="cn.flightfeather.supervision.domain.mapper.LawsRegulationsMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LawsRegulations" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="LR_GUID" property="lrGuid" jdbcType="VARCHAR" />
    <result column="LR_ResourceTitle" property="lrResourcetitle" jdbcType="VARCHAR" />
    <result column="LR_ResourceLevel" property="lrResourcelevel" jdbcType="INTEGER" />
    <result column="LR_PicUrl" property="lrPicurl" jdbcType="VARCHAR" />
    <result column="LR_BodyUrl" property="lrBodyurl" jdbcType="VARCHAR" />
    <result column="LR_IsForeign" property="lrIsforeign" jdbcType="BIT" />
    <result column="LR_ResourceTypeId" property="lrResourcetypeid" jdbcType="INTEGER" />
    <result column="LR_IsOpen" property="lrIsopen" jdbcType="BIT" />
    <result column="LR_IsUse" property="lrIsuse" jdbcType="BIT" />
    <result column="LR_ResourceFileType" property="lrResourcefiletype" jdbcType="INTEGER" />
    <result column="LR_IsUseOutUrls" property="lrIsuseouturls" jdbcType="BIT" />
    <result column="LR_ResourceOutUrls" property="lrResourceouturls" jdbcType="VARCHAR" />
    <result column="LR_ResourceUrls" property="lrResourceurls" jdbcType="VARCHAR" />
    <result column="LR_CreatorId" property="lrCreatorid" jdbcType="VARCHAR" />
    <result column="LR_Creator" property="lrCreator" jdbcType="VARCHAR" />
    <result column="LR_CreateDate" property="lrCreatedate" jdbcType="TIMESTAMP" />
    <result column="LR_ModifierId" property="lrModifierid" jdbcType="VARCHAR" />
    <result column="LR_Modifier" property="lrModifier" jdbcType="VARCHAR" />
    <result column="LR_UpdateDate" property="lrUpdatedate" jdbcType="TIMESTAMP" />
    <result column="LR_PublishId" property="lrPublishid" jdbcType="VARCHAR" />
    <result column="LR_Publish" property="lrPublish" jdbcType="VARCHAR" />
    <result column="LR_PublishDate" property="lrPublishdate" jdbcType="TIMESTAMP" />
    <result column="LR_Version" property="lrVersion" jdbcType="VARCHAR" />
    <result column="LR_Extension1" property="lrExtension1" jdbcType="VARCHAR" />
    <result column="LR_Extension2" property="lrExtension2" jdbcType="VARCHAR" />
    <result column="LR_Extension3" property="lrExtension3" jdbcType="VARCHAR" />
    <result column="LR_Remark" property="lrRemark" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="cn.flightfeather.supervision.domain.entity.LawsRegulations" extends="BaseResultMap" >
    <!--
      WARNING - @mbg.generated
    -->
    <result column="LR_Keywords" property="lrKeywords" jdbcType="LONGVARCHAR" />
    <result column="LR_ResourceDesc" property="lrResourcedesc" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    LR_GUID, LR_ResourceTitle, LR_ResourceLevel, LR_PicUrl, LR_BodyUrl, LR_IsForeign, 
    LR_ResourceTypeId, LR_IsOpen, LR_IsUse, LR_ResourceFileType, LR_IsUseOutUrls, LR_ResourceOutUrls, 
    LR_ResourceUrls, LR_CreatorId, LR_Creator, LR_CreateDate, LR_ModifierId, LR_Modifier, 
    LR_UpdateDate, LR_PublishId, LR_Publish, LR_PublishDate, LR_Version, LR_Extension1, 
    LR_Extension2, LR_Extension3, LR_Remark
  </sql>
  <sql id="Blob_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    LR_Keywords, LR_ResourceDesc
  </sql>
 
  <select id="getLawsRegulations" resultMap="BaseResultMap">
    select t1.*
    from ec_t_lawsregulations t1
    where t1.LR_IsForeign = #{param2} and t1.LR_IsOpen = #{param5} and t1.LR_IsUse = #{param6}
    <if test="param1 != null">
      and t1.LR_ResourceLevel = #{param1}
    </if>
    <if test="param3 != null">
      and t1.LR_ResourceTypeId = #{param3}
    </if>
    <if test="param4 != null">
      and t1.LR_Keywords like #{param4}
    </if>
    <if test="param8 != null">
      and (LR_Extension1 is NULL or LR_Extension1 like CONCAT('%', #{param8},'%'))
    </if>
#       获取最新的 param7 个资讯
    <if test="param7 != null">
      and (select count(*) + 1
        from ec_t_lawsregulations t2
        where     t2.LR_ResourceTypeId = t1.LR_ResourceTypeId
        AND t2.LR_PublishDate > t1.LR_PublishDate
      <if test="param1 != null">
        and t1.LR_ResourceLevel = #{param1}
      </if>
      <if test="param4 != null">
        and t1.LR_Keywords like #{param4}
      </if>
      <if test="param8 != null and param8 != 0">
        and (LR_Extension1 is NULL or LR_Extension1 like CONCAT('%', #{param8},'%'))
      </if><![CDATA[
      )
      <= #{param7}
      order by t1.LR_ResourceTypeId,
        t1.LR_PublishDate DESC
    ]]></if>
  </select>
</mapper>