WfAssetManageMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.xjrsoft.module.asset.mapper.WfAssetManageMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.asset.dto.WfAssetManagePageDto"
  7. resultType="com.xjrsoft.module.asset.vo.WfAssetManagePageVo">
  8. select
  9. t.*,
  10. t1.name as assetTypeCn,
  11. t2.name as assetCategoryCn,
  12. t3.name as assetSpeciesCn,
  13. t4.name as deptIdCn,
  14. t5.name as userIdCn
  15. from wf_asset_manage t
  16. left join xjr_dictionary_detail t1 on t1.code = t.asset_type and t1.item_id = '1773620475495190530'
  17. left join xjr_dictionary_detail t2 on t2.code = t.asset_category and t2.item_id = '1773620610862157826'
  18. left join xjr_dictionary_detail t3 on t3.code = t.asset_species and t3.item_id = '1773620783726202882'
  19. left join xjr_department t4 on t4.id = t.dept_id
  20. left join xjr_user t5 on t5.id = t.user_id
  21. where t.delete_mark = 0
  22. <if test="dto.assetType != null and dto.assetType != ''">
  23. and t.asset_type = #{dto.assetType}
  24. </if>
  25. <if test="dto.assetCategory != null and dto.assetCategory != ''">
  26. and t.asset_category = #{dto.assetCategory}
  27. </if>
  28. <if test="dto.assetSpecies != null and dto.assetSpecies != ''">
  29. and t.asset_species = #{dto.assetSpecies}
  30. </if>
  31. <if test="dto.name != null and dto.name != ''">
  32. and t.name like concat('%', #{dto.name}, '%')
  33. </if>
  34. <if test="dto.deptId != null and dto.deptId != ''">
  35. and t.dept_id = #{dto.deptId}
  36. </if>
  37. <if test="dto.userId != null and dto.userId != ''">
  38. and t.user_id = #{dto.userId}
  39. </if>
  40. </select>
  41. <select id="listWfAssetManageSelectRecordQuery" parameterType="com.xjrsoft.module.asset.dto.WfAssetManageSelectRecordQueryDto"
  42. resultType="com.xjrsoft.module.asset.vo.WfAssetManageQueryVo">
  43. select
  44. t.*,
  45. t1.name as assetTypeCn,
  46. t2.name as assetCategoryCn,
  47. t3.name as assetSpeciesCn,
  48. t4.name as deptIdCn,
  49. t5.name as userIdCn
  50. from wf_asset_manage t
  51. left join xjr_dictionary_detail t1 on t1.code = t.asset_type and t1.item_id = '1773620475495190530'
  52. left join xjr_dictionary_detail t2 on t2.code = t.asset_category and t2.item_id = '1773620610862157826'
  53. left join xjr_dictionary_detail t3 on t3.code = t.asset_species and t3.item_id = '1773620783726202882'
  54. left join xjr_department t4 on t4.id = t.dept_id
  55. left join xjr_user t5 on t5.id = t.user_id
  56. where t.delete_mark = 0
  57. <if test="dto.ids != null and !dto.ids.isEmpty()">
  58. and t.id in
  59. <foreach item="id" index="index" collection="dto.ids" open="(" close=")"
  60. separator=",">
  61. #{id}
  62. </foreach>
  63. </if>
  64. </select>
  65. <select id="listWfAssetManageConditionalSearchQuery" parameterType="com.xjrsoft.module.asset.dto.WfAssetManageConditionalSearchQueryDto"
  66. resultType="com.xjrsoft.module.asset.vo.WfAssetManageQueryVo">
  67. select
  68. t.*,
  69. t1.name as assetTypeCn,
  70. t2.name as assetCategoryCn,
  71. t3.name as assetSpeciesCn,
  72. t4.name as deptIdCn,
  73. t5.name as userIdCn
  74. from wf_asset_manage t
  75. left join xjr_dictionary_detail t1 on t1.code = t.asset_type and t1.item_id = '1773620475495190530'
  76. left join xjr_dictionary_detail t2 on t2.code = t.asset_category and t2.item_id = '1773620610862157826'
  77. left join xjr_dictionary_detail t3 on t3.code = t.asset_species and t3.item_id = '1773620783726202882'
  78. left join xjr_department t4 on t4.id = t.dept_id
  79. left join xjr_user t5 on t5.id = t.user_id
  80. where t.delete_mark = 0
  81. <if test="dto.assetType != null and dto.assetType != ''">
  82. and t.asset_type = #{dto.assetType}
  83. </if>
  84. <if test="dto.assetCategory != null and dto.assetCategory != ''">
  85. and t.asset_category = #{dto.assetCategory}
  86. </if>
  87. <if test="dto.assetSpecies != null and dto.assetSpecies != ''">
  88. and t.asset_species = #{dto.assetSpecies}
  89. </if>
  90. <if test="dto.name != null and dto.name != ''">
  91. and t.name like concat('%', #{dto.name}, '%')
  92. </if>
  93. <if test="dto.deptId != null and dto.deptId != ''">
  94. and t.dept_id = #{dto.deptId}
  95. </if>
  96. <if test="dto.userId != null and dto.userId != ''">
  97. and t.user_id = #{dto.userId}
  98. </if>
  99. </select>
  100. </mapper>