SecretAccountMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.bdglSecret.mapper.SecretAccountMapper">
  6. <resultMap type="SecretAccount" id="SecretAccountResult">
  7. <result property="id" column="id" />
  8. <result property="unitname" column="unitName" />
  9. <result property="stype" column="stype" />
  10. <result property="brand" column="brand" />
  11. <result property="model" column="model" />
  12. <result property="harddisknumber" column="hardDiskNumber" />
  13. <result property="macaddress" column="macAddress" />
  14. <result property="confidentialitylevel" column="confidentialityLevel" />
  15. <result property="levelnumber" column="levelNumber" />
  16. <result property="persoeliable" column="persoeLiable" />
  17. <result property="remarks" column="remarks" />
  18. <result property="unitid" column="unitId" />
  19. </resultMap>
  20. <sql id="selectSecretAccountVo">
  21. select id, unitName, stype, brand, model, hardDiskNumber, macAddress, confidentialityLevel, levelNumber, persoeLiable, remarks, unitId from secret_account
  22. </sql>
  23. <select id="selectSecretAccountList" parameterType="SecretAccount" resultMap="SecretAccountResult">
  24. <include refid="selectSecretAccountVo"/>
  25. <where>
  26. <if test="unitname != null and unitname != ''"> and unitName like concat('%', #{unitname}, '%')</if>
  27. <if test="stype != null and stype != ''"> and stype = #{stype}</if>
  28. <if test="brand != null and brand != ''"> and brand = #{brand}</if>
  29. <if test="model != null and model != ''"> and model = #{model}</if>
  30. <if test="harddisknumber != null and harddisknumber != ''"> and hardDiskNumber = #{harddisknumber}</if>
  31. <if test="macaddress != null and macaddress != ''"> and macAddress = #{macaddress}</if>
  32. <if test="confidentialitylevel != null and confidentialitylevel != ''"> and confidentialityLevel = #{confidentialitylevel}</if>
  33. <if test="levelnumber != null and levelnumber != ''"> and levelNumber = #{levelnumber}</if>
  34. <if test="persoeliable != null and persoeliable != ''"> and persoeLiable = #{persoeliable}</if>
  35. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  36. <if test="unitid != null "> and unitId = #{unitid}</if>
  37. </where>
  38. </select>
  39. <select id="selectSecretAccountById" parameterType="Long" resultMap="SecretAccountResult">
  40. <include refid="selectSecretAccountVo"/>
  41. where id = #{id}
  42. </select>
  43. <insert id="insertSecretAccount" parameterType="SecretAccount">
  44. insert into secret_account
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="id != null">id,</if>
  47. <if test="unitname != null">unitName,</if>
  48. <if test="stype != null">stype,</if>
  49. <if test="brand != null">brand,</if>
  50. <if test="model != null">model,</if>
  51. <if test="harddisknumber != null">hardDiskNumber,</if>
  52. <if test="macaddress != null">macAddress,</if>
  53. <if test="confidentialitylevel != null">confidentialityLevel,</if>
  54. <if test="levelnumber != null">levelNumber,</if>
  55. <if test="persoeliable != null">persoeLiable,</if>
  56. <if test="remarks != null">remarks,</if>
  57. <if test="unitid != null">unitId,</if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="id != null">#{id},</if>
  61. <if test="unitname != null">#{unitname},</if>
  62. <if test="stype != null">#{stype},</if>
  63. <if test="brand != null">#{brand},</if>
  64. <if test="model != null">#{model},</if>
  65. <if test="harddisknumber != null">#{harddisknumber},</if>
  66. <if test="macaddress != null">#{macaddress},</if>
  67. <if test="confidentialitylevel != null">#{confidentialitylevel},</if>
  68. <if test="levelnumber != null">#{levelnumber},</if>
  69. <if test="persoeliable != null">#{persoeliable},</if>
  70. <if test="remarks != null">#{remarks},</if>
  71. <if test="unitid != null">#{unitid},</if>
  72. </trim>
  73. </insert>
  74. <update id="updateSecretAccount" parameterType="SecretAccount">
  75. update secret_account
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="unitname != null">unitName = #{unitname},</if>
  78. <if test="stype != null">stype = #{stype},</if>
  79. <if test="brand != null">brand = #{brand},</if>
  80. <if test="model != null">model = #{model},</if>
  81. <if test="harddisknumber != null">hardDiskNumber = #{harddisknumber},</if>
  82. <if test="macaddress != null">macAddress = #{macaddress},</if>
  83. <if test="confidentialitylevel != null">confidentialityLevel = #{confidentialitylevel},</if>
  84. <if test="levelnumber != null">levelNumber = #{levelnumber},</if>
  85. <if test="persoeliable != null">persoeLiable = #{persoeliable},</if>
  86. <if test="remarks != null">remarks = #{remarks},</if>
  87. <if test="unitid != null">unitId = #{unitid},</if>
  88. </trim>
  89. where id = #{id}
  90. </update>
  91. <delete id="deleteSecretAccountById" parameterType="Long">
  92. delete from secret_account where id = #{id}
  93. </delete>
  94. <delete id="deleteSecretAccountByIds" parameterType="String">
  95. delete from secret_account where id in
  96. <foreach item="id" collection="array" open="(" separator="," close=")">
  97. #{id}
  98. </foreach>
  99. </delete>
  100. </mapper>