MobileBannerInfo.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.MobileBannerInfoDAO">
  6. <resultMap id="MobileBannerInfoMap" type="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
  7. <id property="id" column="id_"/>
  8. <result property="name" column="name_"/>
  9. <result property="classify" column="classify_"/>
  10. <result property="linkUrl" column="link_url"/>
  11. <result property="picUrl" column="pic_url"/>
  12. <result property="createBy" column="create_by"/>
  13. <result property="createTime" column="create_time"/>
  14. <result property="updateBy" column="update_by"/>
  15. <result property="updateTime" column="update_time"/>
  16. <result property="delFlag" column="del_flag"/>
  17. <result property="enabled" column="enabled_"/>
  18. <result property="sortNo" column="sort_no"/>
  19. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
  21. <!--
  22. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  23. select sys_guid() from dual
  24. </selectKey>
  25. -->
  26. <![CDATA[
  27. insert into base_mobile_banner_info
  28. (id_,name_,classify_,link_url,pic_url,create_by,create_time,update_by,update_time,del_flag,enabled_,sort_no)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{name,jdbcType=VARCHAR}
  33. ,#{classify,jdbcType= VARCHAR }
  34. ,#{linkUrl,jdbcType=VARCHAR}
  35. ,#{picUrl,jdbcType=VARCHAR}
  36. ,#{createBy,jdbcType=VARCHAR}
  37. ,#{createTime,jdbcType= TIMESTAMP }
  38. ,#{updateBy,jdbcType=VARCHAR}
  39. ,#{updateTime,jdbcType= TIMESTAMP }
  40. ,#{delFlag,jdbcType= NUMERIC }
  41. ,#{enabled,jdbcType=VARCHAR}
  42. ,#{sortNo,jdbcType= NUMERIC }
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_mobile_banner_info where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
  50. update base_mobile_banner_info
  51. <set>
  52. <if test="name!=null">
  53. name_=#{name,jdbcType=VARCHAR},
  54. </if>
  55. <if test="classify!=null">
  56. classify_=#{classify,jdbcType= VARCHAR },
  57. </if>
  58. <if test="linkUrl!=null">
  59. link_url=#{linkUrl,jdbcType=VARCHAR},
  60. </if>
  61. <if test="picUrl!=null">
  62. pic_url=#{picUrl,jdbcType=VARCHAR},
  63. </if>
  64. <if test="createBy!=null">
  65. create_by=#{createBy,jdbcType=VARCHAR},
  66. </if>
  67. <if test="createTime!=null">
  68. create_time=#{createTime,jdbcType= TIMESTAMP },
  69. </if>
  70. <if test="updateBy!=null">
  71. update_by=#{updateBy,jdbcType=VARCHAR},
  72. </if>
  73. <if test="updateTime!=null">
  74. update_time=#{updateTime,jdbcType= TIMESTAMP },
  75. </if>
  76. <if test="delFlag!=null">
  77. del_flag=#{delFlag,jdbcType= NUMERIC },
  78. </if>
  79. <if test="enabled!=null">
  80. enabled_=#{enabled,jdbcType=NUMERIC},
  81. </if>
  82. <if test="sortNo!=null">
  83. sort_no=#{sortNo,jdbcType=NUMERIC},
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="MobileBannerInfoMap">
  89. select * from
  90. base_mobile_banner_info where id_=#{0}
  91. </select>
  92. <select id="exist" parameterType="string" resultType="int">
  93. select count(*) from base_mobile_banner_info where id_=#{0}
  94. </select>
  95. <select id="list" resultMap="MobileBannerInfoMap">
  96. select * from base_mobile_banner_info
  97. </select>
  98. <select id="getBannerInfo" resultMap="MobileBannerInfoMap">
  99. select * from base_mobile_banner_info where classify_=#{0} and enabled_ =1 and del_flag=0
  100. order by sort_no asc
  101. </select>
  102. <select id="search" parameterType="hashmap" resultMap="MobileBannerInfoMap">
  103. <![CDATA[
  104. select * from base_mobile_banner_info
  105. ]]>
  106. <where>
  107. del_flag=0
  108. <if test="searchParams.name != null">
  109. and name_ like #{searchParams.name}
  110. </if>
  111. <if test="searchParams.classify != null">
  112. and classify_ = #{searchParams.classify}
  113. </if>
  114. </where>
  115. <foreach item="sort" collection="sortList" open="order by" separator=",">
  116. ${sort.name} ${sort.order}
  117. </foreach>
  118. </select>
  119. </mapper>