You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.5 KiB

2 years ago
  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.spring.modules.oss.dao.SysOssDao">
  4. <select id="getSysOssEntityList" resultType="com.spring.modules.oss.vo.SysOssEntityData"
  5. parameterType="com.spring.modules.oss.vo.SysOssEntityData">
  6. select A.id,A.url,A.create_date,A.file_name,A.new_file_name,A.created_by
  7. from sys_oss A
  8. left join file_associate B on A.id = B.sys_oss_id
  9. <where>
  10. <if test="site != null and site != ''">
  11. and B.site = #{site ,jdbcType = VARCHAR}
  12. </if>
  13. <if test="type != null and type != ''">
  14. and B.type = #{type ,jdbcType = VARCHAR}
  15. </if>
  16. <if test="associatedField1 != null and associatedField1 != ''">
  17. and B.associated_field1 = #{associatedField1 ,jdbcType = VARCHAR}
  18. </if>
  19. <if test="associatedField2 != null and associatedField2 != ''">
  20. and B.associated_field2 = #{associatedField2 ,jdbcType = VARCHAR}
  21. </if>
  22. <if test="associatedField3 != null and associatedField3 != ''">
  23. and B.associated_field3 = #{associatedField3,jdbcType=VARCHAR}
  24. </if>
  25. </where>
  26. </select>
  27. <select id="queryPage" resultType="com.spring.modules.oss.vo.OssVo">
  28. SELECT
  29. id,
  30. url,
  31. create_date,
  32. file_name,
  33. new_file_name,
  34. created_by,
  35. order_ref1,
  36. order_ref2,
  37. order_ref3,
  38. file_type,
  39. file_suffix,
  40. file_type_code,
  41. dbo.file_type_resource ( ISNULL( file_type_code, - 1 ), order_ref1, order_ref2, order_ref3 ) as order_info
  42. FROM
  43. sys_oss
  44. <where>
  45. <if test="query.fileTypeCode != '' and query.fileTypeCode !=null ">
  46. file_type_code = #{query.fileTypeCode}
  47. </if>
  48. <if test="query.fileName != '' and query.fileName !=null ">
  49. and file_name like #{query.fileName}
  50. </if>
  51. <if test="query.orderRef1 != '' and query.orderRef1 !=null ">
  52. and order_ref1 = #{query.orderRef1}
  53. </if>
  54. <if test="query.orderRef2 != '' and query.orderRef2 !=null ">
  55. and order_ref2 = #{query.orderRef2}
  56. </if>
  57. <if test="query.orderRef3 != '' and query.orderRef3 !=null ">
  58. and order_ref3 = #{query.orderRef3}
  59. </if>
  60. </where>
  61. </select>
  62. </mapper>