feiyu02
2024-08-15 196bb14112448857a885e32dc4149e308e00b01a
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
98
99
100
101
102
103
104
105
106
<?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" jdbcType="VARCHAR" property="lrGuid" />
    <result column="LR_ResourceTitle" jdbcType="VARCHAR" property="lrResourcetitle" />
    <result column="LR_ResourceLevel" jdbcType="INTEGER" property="lrResourcelevel" />
    <result column="LR_ResourceTypeId" jdbcType="INTEGER" property="lrResourcetypeid" />
    <result column="LR_ResourceFileType" jdbcType="INTEGER" property="lrResourcefiletype" />
    <result column="LR_PicUrl" jdbcType="VARCHAR" property="lrPicurl" />
    <result column="LR_BodyUrl" jdbcType="VARCHAR" property="lrBodyurl" />
    <result column="LR_IsForeign" jdbcType="BIT" property="lrIsforeign" />
    <result column="LR_IsOpen" jdbcType="BIT" property="lrIsopen" />
    <result column="LR_IsUse" jdbcType="BIT" property="lrIsuse" />
    <result column="LR_IsUseOutUrls" jdbcType="BIT" property="lrIsuseouturls" />
    <result column="LR_ResourceOutUrls" jdbcType="VARCHAR" property="lrResourceouturls" />
    <result column="LR_ResourceUrls" jdbcType="VARCHAR" property="lrResourceurls" />
    <result column="LR_CreatorId" jdbcType="VARCHAR" property="lrCreatorid" />
    <result column="LR_Creator" jdbcType="VARCHAR" property="lrCreator" />
    <result column="LR_CreateDate" jdbcType="TIMESTAMP" property="lrCreatedate" />
    <result column="LR_ModifierId" jdbcType="VARCHAR" property="lrModifierid" />
    <result column="LR_Modifier" jdbcType="VARCHAR" property="lrModifier" />
    <result column="LR_UpdateDate" jdbcType="TIMESTAMP" property="lrUpdatedate" />
    <result column="LR_PublishId" jdbcType="VARCHAR" property="lrPublishid" />
    <result column="LR_Publish" jdbcType="VARCHAR" property="lrPublish" />
    <result column="LR_PublishDate" jdbcType="TIMESTAMP" property="lrPublishdate" />
    <result column="LR_Version" jdbcType="VARCHAR" property="lrVersion" />
    <result column="BI_Province_Code" jdbcType="VARCHAR" property="biProvinceCode" />
    <result column="BI_Province_Name" jdbcType="VARCHAR" property="biProvinceName" />
    <result column="BI_City_Code" jdbcType="VARCHAR" property="biCityCode" />
    <result column="BI_City_Name" jdbcType="VARCHAR" property="biCityName" />
    <result column="BI_District_Code" jdbcType="VARCHAR" property="biDistrictCode" />
    <result column="BI_District_Name" jdbcType="VARCHAR" property="biDistrictName" />
    <result column="BI_Town_Code" jdbcType="VARCHAR" property="biTownCode" />
    <result column="BI_Town_Name" jdbcType="VARCHAR" property="biTownName" />
    <result column="LR_Extension1" jdbcType="VARCHAR" property="lrExtension1" />
    <result column="LR_Extension2" jdbcType="VARCHAR" property="lrExtension2" />
    <result column="LR_Extension3" jdbcType="VARCHAR" property="lrExtension3" />
    <result column="LR_Remark" jdbcType="VARCHAR" property="lrRemark" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.flightfeather.supervision.domain.entity.LawsRegulations">
    <!--
      WARNING - @mbg.generated
    -->
    <result column="LR_ResourceDesc" jdbcType="LONGVARCHAR" property="lrResourcedesc" />
    <result column="LR_Keywords" jdbcType="LONGVARCHAR" property="lrKeywords" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    LR_GUID, LR_ResourceTitle, LR_ResourceLevel, LR_ResourceTypeId, LR_ResourceFileType, 
    LR_PicUrl, LR_BodyUrl, LR_IsForeign, LR_IsOpen, LR_IsUse, 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, BI_Province_Code, 
    BI_Province_Name, BI_City_Code, BI_City_Name, BI_District_Code, BI_District_Name, 
    BI_Town_Code, BI_Town_Name, LR_Extension1, LR_Extension2, LR_Extension3, LR_Remark
  </sql>
  <sql id="Blob_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    LR_ResourceDesc, LR_Keywords
  </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 &gt; 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>