RegionDao.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.sqx.modules.baseDate.dao.RegionDao">
  4. <select id="selectRegion" resultType="Map">
  5. select region_id,parent_id,region_name,status,ischildren,idtree from tb_region where isdelete=0
  6. <if test ='0 != parentId'>
  7. and parent_id=#{parentId}
  8. </if>
  9. <if test ='0 == parentId'>
  10. and parent_id=0
  11. </if>
  12. </select>
  13. <!--<insert id="insertRegion" useGeneratedKeys="true" keyColumn="regionId" keyProperty="regionId" parameterType="com.sqx.modules.app.order.entity.Order">
  14. insert into tb_region
  15. <trim prefix="(" suffix=")" suffixOverrides=",">
  16. <if test ='null != regionName'>
  17. region_name,
  18. </if>
  19. <if test ='null != status'>
  20. status,
  21. </if>
  22. <if test ='null != ischildren'>
  23. ischildren
  24. </if>
  25. </trim>
  26. <trim prefix="values (" suffix=")" suffixOverrides=",">
  27. <if test ='null != regionName'>
  28. #{regionName},
  29. </if>
  30. <if test ='null != status'>
  31. #{status},
  32. </if>
  33. <if test ='null != ischildren'>
  34. #{ischildren}
  35. </if>
  36. </trim>
  37. </insert>-->
  38. <update id="updateIschildren">
  39. update tb_region set ischildren=1 where 1=1
  40. <if test ='null != id'>
  41. and region_id=#{id}
  42. </if>
  43. </update>
  44. <update id="updateStatus">
  45. update tb_region set
  46. status= #{status}
  47. where 1=1
  48. <if test ='null != id'>
  49. and idtree like #{id}
  50. </if>
  51. </update>
  52. <update id="deleteRegion">
  53. update tb_region set isdelete =1 where idtree like #{id}
  54. </update>
  55. </mapper>