BisInspLoginInfoDao.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.BisInspLoginInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspLoginInfo" id="bisInspLoginInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="userName" column="USER_NAME"/>
  7. <result property="ip" column="IP"/>
  8. <result property="loginLocation" column="LOGIN_LOCATION"/>
  9. <result property="browser" column="BROWSER"/>
  10. <result property="os" column="OS"/>
  11. <result property="status" column="STATUS"/>
  12. <result property="msg" column="MSG"/>
  13. <result property="loginTime" column="LOGIN_TIME"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="uptm" column="UPTM"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. ID,
  20. USER_NAME,
  21. IP,
  22. LOGIN_LOCATION,
  23. BROWSER,
  24. OS,
  25. STATUS,
  26. MSG,
  27. LOGIN_TIME,
  28. INTM,
  29. UPTM,
  30. DATA_STAT
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},
  34. #{userName},
  35. #{ip},
  36. #{loginLocation},
  37. #{browser},
  38. #{os},
  39. #{status},
  40. #{msg},
  41. #{loginTime},
  42. #{intm},
  43. #{uptm},
  44. #{dataStat}
  45. </sql>
  46. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  47. <sql id="page_where">
  48. <trim prefix="where" prefixOverrides="and | or ">
  49. <if test="userName != null and userName != ''">and USER_NAME = #{userName}</if>
  50. <if test="ip != null and ip != ''">and IP = #{ip}</if>
  51. <if test="loginLocation != null and loginLocation != ''">and LOGIN_LOCATION = #{loginLocation}</if>
  52. <if test="browser != null and browser != ''">and BROWSER = #{browser}</if>
  53. <if test="os != null and os != ''">and OS = #{os}</if>
  54. <if test="status != null and status != ''">and STATUS = #{status}</if>
  55. <if test="msg != null and msg != ''">and MSG = #{msg}</if>
  56. <if test="loginTime != null">and LOGIN_TIME = #{loginTime}</if>
  57. <if test="intm != null">and INTM = #{intm}</if>
  58. <if test="uptm != null">and UPTM = #{uptm}</if>
  59. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  60. </trim>
  61. </sql>
  62. <select id="get" resultMap="bisInspLoginInfoResultMap" parameterType="String" >
  63. select <include refid="table_columns" /> from BIS_INSP_LOGIN_INFO where ID = #{id}
  64. </select>
  65. <select id="getBy" resultMap="bisInspLoginInfoResultMap">
  66. select <include refid="table_columns" /> from BIS_INSP_LOGIN_INFO <include refid="page_where" />
  67. </select>
  68. <select id="findAll" resultMap="bisInspLoginInfoResultMap">
  69. select <include refid="table_columns" /> from BIS_INSP_LOGIN_INFO
  70. </select>
  71. <select id="findList" resultMap="bisInspLoginInfoResultMap">
  72. select <include refid="table_columns" /> from BIS_INSP_LOGIN_INFO <include refid="page_where" />
  73. </select>
  74. <select id="selectCount" resultType="int" >
  75. select count(ID) from BIS_INSP_LOGIN_INFO <include refid="page_where" />
  76. </select>
  77. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspLoginInfo">
  78. insert into BIS_INSP_LOGIN_INFO( <include refid="table_columns" /> )
  79. values ( <include refid="entity_properties" /> )
  80. </insert>
  81. <delete id="delete" parameterType="java.lang.String">
  82. update BIS_INSP_LOGIN_INFO set DATA_STAT='9' where ID = #{id}
  83. </delete>
  84. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspLoginInfo">
  85. delete from BIS_INSP_LOGIN_INFO <include refid="page_where" />
  86. </delete>
  87. <update id="deleteInFlag" parameterType="java.lang.String">
  88. update BIS_INSP_LOGIN_INFO set flag_valid = 0 where ID = #{id}
  89. </update>
  90. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspLoginInfo">
  91. update BIS_INSP_LOGIN_INFO
  92. <trim prefix="set" suffixOverrides=",">
  93. <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
  94. <if test="ip != null and ip != ''">IP = #{ip},</if>
  95. <if test="loginLocation != null and loginLocation != ''">LOGIN_LOCATION = #{loginLocation},</if>
  96. <if test="browser != null and browser != ''">BROWSER = #{browser},</if>
  97. <if test="os != null and os != ''">OS = #{os},</if>
  98. <if test="status != null and status != ''">STATUS = #{status},</if>
  99. <if test="msg != null and msg != ''">MSG = #{msg},</if>
  100. <if test="loginTime != null">LOGIN_TIME = #{loginTime},</if>
  101. <if test="intm != null">INTM = #{intm},</if>
  102. <if test="uptm != null">UPTM = #{uptm},</if>
  103. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  104. </trim>
  105. <where>ID = #{id}</where>
  106. </update>
  107. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspLoginInfo">
  108. update BIS_INSP_LOGIN_INFO
  109. <trim prefix="set" suffixOverrides=",">
  110. <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
  111. <if test="ip != null and ip != ''">IP = #{ip},</if>
  112. <if test="loginLocation != null and loginLocation != ''">LOGIN_LOCATION = #{loginLocation},</if>
  113. <if test="browser != null and browser != ''">BROWSER = #{browser},</if>
  114. <if test="os != null and os != ''">OS = #{os},</if>
  115. <if test="status != null and status != ''">STATUS = #{status},</if>
  116. <if test="msg != null and msg != ''">MSG = #{msg},</if>
  117. <if test="loginTime != null">LOGIN_TIME = #{loginTime},</if>
  118. <if test="intm != null">INTM = #{intm},</if>
  119. <if test="uptm != null">UPTM = #{uptm},</if>
  120. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  121. </trim>
  122. <include refid="page_where" />
  123. </update>
  124. <!-- 其他自定义SQL -->
  125. </mapper>