GwSmsLogDao.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.GwSmsLogDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.GwSmsLog" id="gwSmsLogResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="type" column="TYPE"/>
  7. <result property="phone" column="PHONE"/>
  8. <result property="content" column="CONTENT"/>
  9. <result property="returnCode" column="RETURN_CODE"/>
  10. <result property="code" column="CODE"/>
  11. <result property="func" column="FUNC"/>
  12. <result property="ip" column="IP"/>
  13. <result property="userId" column="USER_ID"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="relUserId" column="REL_USER_ID"/>
  16. </resultMap>
  17. <sql id="table_columns">
  18. ID,
  19. TYPE,
  20. PHONE,
  21. CONTENT,
  22. RETURN_CODE,
  23. CODE,
  24. FUNC,
  25. IP,
  26. USER_ID,
  27. INTM,
  28. REL_USER_ID
  29. </sql>
  30. <sql id="entity_properties">
  31. #{id},
  32. #{type},
  33. #{phone},
  34. #{content},
  35. #{returnCode},
  36. #{code},
  37. #{func},
  38. #{ip},
  39. #{userId},
  40. #{intm},
  41. #{relUserId}
  42. </sql>
  43. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  44. <sql id="page_where">
  45. <trim prefix="where" prefixOverrides="and | or ">
  46. <if test="type != null and type != ''">and TYPE = #{type}</if>
  47. <if test="phone != null and phone != ''">and PHONE = #{phone}</if>
  48. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  49. <if test="returnCode != null and returnCode != ''">and RETURN_CODE = #{returnCode}</if>
  50. <if test="code != null and code != ''">and CODE = #{code}</if>
  51. <if test="func != null and func != ''">and FUNC = #{func}</if>
  52. <if test="ip != null and ip != ''">and IP = #{ip}</if>
  53. <if test="userId != null and userId != ''">and USER_ID = #{userId}</if>
  54. <if test="intm != null">and INTM = #{intm}</if>
  55. <if test="relUserId != null and relUserId != ''">and REL_USER_ID = #{relUserId}</if>
  56. </trim>
  57. </sql>
  58. <select id="get" resultMap="gwSmsLogResultMap" parameterType="String">
  59. select
  60. <include refid="table_columns"/>
  61. from GW_SMS_LOG where ID = #{id}
  62. </select>
  63. <select id="getBy" resultMap="gwSmsLogResultMap">
  64. select
  65. <include refid="table_columns"/>
  66. from GW_SMS_LOG
  67. <include refid="page_where"/>
  68. </select>
  69. <select id="findAll" resultMap="gwSmsLogResultMap">
  70. select
  71. <include refid="table_columns"/>
  72. from GW_SMS_LOG
  73. </select>
  74. <select id="findList" resultMap="gwSmsLogResultMap">
  75. select
  76. <include refid="table_columns"/>
  77. from GW_SMS_LOG
  78. <include refid="page_where"/>
  79. </select>
  80. <select id="selectCount" resultType="int">
  81. select count(ID) from GW_SMS_LOG
  82. <include refid="page_where"/>
  83. </select>
  84. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.GwSmsLog">
  85. insert into GW_SMS_LOG(
  86. <include refid="table_columns"/>
  87. )
  88. values (
  89. <include refid="entity_properties"/>
  90. )
  91. </insert>
  92. <delete id="delete" parameterType="java.lang.String">
  93. update GW_SMS_LOG set DATA_STAT='9' where ID = #{id}
  94. </delete>
  95. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.GwSmsLog">
  96. update GW_SMS_LOG set DATA_STAT='9'
  97. <include refid="page_where"/>
  98. </delete>
  99. <update id="deleteInFlag" parameterType="java.lang.String">
  100. update GW_SMS_LOG set DATA_STAT = '9' where ID = #{id}
  101. </update>
  102. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.GwSmsLog">
  103. update GW_SMS_LOG
  104. <trim prefix="set" suffixOverrides=",">
  105. <if test="type != null and type != ''">TYPE = #{type},</if>
  106. <if test="phone != null and phone != ''">PHONE = #{phone},</if>
  107. <if test="content != null and content != ''">CONTENT = #{content},</if>
  108. <if test="returnCode != null and returnCode != ''">RETURN_CODE = #{returnCode},</if>
  109. <if test="code != null and code != ''">CODE = #{code},</if>
  110. <if test="func != null and func != ''">FUNC = #{func},</if>
  111. <if test="ip != null and ip != ''">IP = #{ip},</if>
  112. <if test="userId != null and userId != ''">USER_ID = #{userId},</if>
  113. <if test="intm != null">INTM = #{intm},</if>
  114. <if test="relUserId != null and relUserId != ''">REL_USER_ID = #{relUserId},</if>
  115. </trim>
  116. <where>ID = #{id}</where>
  117. </update>
  118. </mapper>