BisInspQrcodeLoginDao.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.BisInspQrcodeLoginDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspQrcodeLogin" id="bisInspQrcodeLoginResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="status" column="STATUS" jdbcType="VARCHAR"/>
  7. <result property="createTime" column="CREATE_TIME"/>
  8. <result property="content" column="CONTENT"/>
  9. </resultMap>
  10. <sql id="table_columns">
  11. ID,
  12. STATUS ,
  13. CREATE_TIME,
  14. CONTENT
  15. </sql>
  16. <sql id="entity_properties">
  17. #{id},
  18. case when #{status} is null then '0' else '1' end,
  19. #{createTime},
  20. #{content}
  21. </sql>
  22. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  23. <sql id="page_where">
  24. <trim prefix="where" prefixOverrides="and | or ">
  25. <if test="status != null">and STATUS = #{status}</if>
  26. <if test="createTime != null">and CREATE_TIME = #{createTime}</if>
  27. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  28. </trim>
  29. </sql>
  30. <select id="get" resultMap="bisInspQrcodeLoginResultMap" parameterType="String">
  31. select
  32. <include refid="table_columns"/>
  33. from bis_insp_qrcode_login where ID = #{id}
  34. </select>
  35. <select id="getBy" resultMap="bisInspQrcodeLoginResultMap">
  36. select
  37. <include refid="table_columns"/>
  38. from bis_insp_qrcode_login
  39. <include refid="page_where"/>
  40. </select>
  41. <select id="findAll" resultMap="bisInspQrcodeLoginResultMap">
  42. select
  43. <include refid="table_columns"/>
  44. from bis_insp_qrcode_login
  45. </select>
  46. <select id="findList" resultMap="bisInspQrcodeLoginResultMap">
  47. select
  48. <include refid="table_columns"/>
  49. from bis_insp_qrcode_login
  50. <include refid="page_where"/>
  51. </select>
  52. <select id="selectCount" resultType="int">
  53. select count(ID) from bis_insp_qrcode_login
  54. <include refid="page_where"/>
  55. </select>
  56. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspQrcodeLogin">
  57. insert into bis_insp_qrcode_login(
  58. <include refid="table_columns"/>
  59. )
  60. values (
  61. <include refid="entity_properties"/>
  62. )
  63. </insert>
  64. <delete id="delete" parameterType="java.lang.String">
  65. delete from bis_insp_qrcode_login where ID = #{id}
  66. </delete>
  67. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspQrcodeLogin">
  68. delete from bis_insp_qrcode_login
  69. <include refid="page_where"/>
  70. </delete>
  71. <update id="deleteInFlag" parameterType="java.lang.String">
  72. update bis_insp_qrcode_login set flag_valid = 0 where ID = #{id}
  73. </update>
  74. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspQrcodeLogin">
  75. update bis_insp_qrcode_login
  76. <trim prefix="set" suffixOverrides=",">
  77. <if test="status != null">STATUS = #{status},</if>
  78. <if test="createTime != null">CREATE_TIME = #{createTime},</if>
  79. <if test="content != null and content != ''">CONTENT = #{content},</if>
  80. </trim>
  81. <where>ID = #{id}</where>
  82. </update>
  83. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspQrcodeLogin">
  84. update bis_insp_qrcode_login
  85. <trim prefix="set" suffixOverrides=",">
  86. <if test="status != null">STATUS = #{status},</if>
  87. <if test="createTime != null">CREATE_TIME = #{createTime},</if>
  88. <if test="content != null and content != ''">CONTENT = #{content},</if>
  89. </trim>
  90. <include refid="page_where"/>
  91. </update>
  92. <!-- 其他自定义SQL -->
  93. </mapper>