ProjectServiceCategoryDao.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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="platform.modules.government.dao.ProjectServiceCategoryDao">
  4. <select id="findProjectService" resultType="platform.modules.government.entity.ProjectServiceCategory">
  5. </select>
  6. <delete id="deleteByProjectDeclarationId">
  7. update project_service_category set del_flag=1
  8. where project_declaration_id = #{id}
  9. </delete>
  10. <!-- 批量插入-->
  11. <insert id="insertBatch" parameterType="platform.modules.government.entity.ProjectServiceCategory">
  12. INSERT INTO project_service_category
  13. (
  14. id, business_type, pid, project_service_type_id,
  15. project_declaration_id, project_type_name, department_id,
  16. type,
  17. del_flag,create_time,create_by, create_name,
  18. update_time,update_by,update_name
  19. )
  20. VALUES
  21. <foreach collection="list" item="item" open="" separator="," close="">
  22. (
  23. #{item.id}, #{item.business_type}, #{item.pid}, #{item.project_service_type_id},
  24. #{item.project_declaration_id}, #{item.project_type_name},#{item.department_id},
  25. #{item.type},
  26. #{item.del_flag},#{item.create_time},#{item.create_by}, #{item.create_name},
  27. #{item.update_time}, #{item.update_by}, #{item.update_name}
  28. )
  29. </foreach>
  30. </insert>
  31. <select id="findProjectServiceList" resultType="platform.modules.government.entity.ProjectServiceCategory">
  32. SELECT
  33. *
  34. FROM
  35. project_service_category
  36. WHERE
  37. project_declaration_id = #{declarationId}
  38. AND business_type = #{businessType}
  39. AND pid = 0
  40. AND del_flag = 0
  41. </select>
  42. <select id="findProjectNameList" resultType="platform.modules.government.entity.ProjectServiceCategory">
  43. SELECT
  44. *
  45. FROM
  46. project_service_category
  47. WHERE
  48. project_declaration_id = #{declarationId}
  49. AND pid = #{categoryId}
  50. AND del_flag = 0
  51. </select>
  52. <select id="findByPid" resultType="platform.modules.government.entity.ProjectServiceCategory">
  53. SELECT
  54. *
  55. FROM
  56. project_service_category
  57. WHERE
  58. pid = #{serviceId}
  59. AND del_flag = 0
  60. </select>
  61. <select id="selectByProjectDeclarationId" resultType="platform.modules.government.entity.ProjectServiceCategory">
  62. select * from project_service_category where del_flag != 1 and project_declaration_id = #{id}
  63. </select>
  64. </mapper>