File.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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="com.oqpo.api.mapper.FileMapper">
  4. <insert id="insertFile">
  5. <selectKey keyProperty="fileSeq" resultType="int" order="BEFORE">
  6. select (ifnull((select max(file.file_seq) from np_file file where file.file_no = #{fileNo}), 0) + 1) as file_seq
  7. </selectKey>
  8. insert into np_file (
  9. file_no
  10. , file_seq
  11. , file_path
  12. , file_type
  13. , file_nm
  14. , file_org_nm
  15. , file_size
  16. , add_dt
  17. , add_id
  18. ) values (
  19. #{fileNo}
  20. , #{fileSeq}
  21. , #{filePath}
  22. , #{fileType}
  23. , #{fileNm}
  24. , #{fileOrgNm}
  25. , #{fileSize}
  26. , now()
  27. , #{addId}
  28. )
  29. </insert>
  30. <delete id="deleteFile">
  31. delete from np_file
  32. where file_no = #{fileNo}
  33. and file_seq = #{fileSeq}
  34. </delete>
  35. <select id="selectFile" resultType="com.oqpo.api.entity.oper.FileEntity">
  36. select /* selectFile */
  37. file_no
  38. , file_seq
  39. , file_path
  40. , file_type
  41. , file_nm
  42. , file_org_nm
  43. , file_size
  44. from np_file
  45. where file_no = #{fileNo}
  46. and file_seq = #{fileSeq}
  47. </select>
  48. <select id="selectFileList" resultType="com.oqpo.api.entity.oper.FileEntity">
  49. select /* selectFileList */
  50. file_no
  51. , file_seq
  52. , file_path
  53. , file_type
  54. , file_nm
  55. , file_org_nm
  56. , file_size
  57. from np_file
  58. where file_no = #{fileNo}
  59. </select>
  60. </mapper>