DitchMapper.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.ytpm.lemonios.dao.DitchMapper">
  4. <insert id="insertOne" keyProperty="ditchId" useGeneratedKeys="true">
  5. insert into yt_ditch
  6. (
  7. ditch_id,
  8. ditch_name,
  9. user_id,
  10. app_type,
  11. app_id,
  12. is_delete,
  13. create_time
  14. )
  15. values
  16. (
  17. #{ditchId},
  18. #{ditchName},
  19. #{userId},
  20. #{appType},
  21. #{appId},
  22. #{isDelete},
  23. #{createTime}
  24. )
  25. </insert>
  26. <delete id="deleteByAppId">
  27. update yt_ditch set is_delete = 1 where app_id = #{appId}
  28. </delete>
  29. <select id="ditchList" resultType="com.ytpm.agent.view.AgentDitchView">
  30. select ditch_id,
  31. ditch_name,
  32. create_time
  33. from yt_ditch
  34. where user_id = #{userId} and is_delete = 0
  35. </select>
  36. <select id="ditchListByAppId" resultType="com.ytpm.agent.view.AgentDitchView">
  37. select
  38. ditch_id, ditch_name, create_time
  39. from yt_ditch
  40. <where>
  41. is_delete = 0
  42. <if test="appId != null and appId != ''">
  43. and app_id = #{appId}
  44. </if>
  45. </where>
  46. </select>
  47. <select id="selectById" resultType="com.ytpm.agent.model.YtDitch">
  48. select
  49. ditch_id, ditch_name, user_id, app_id, app_type, is_delete, create_time
  50. from yt_ditch
  51. where is_delete = 0 and ditch_id = #{ditchId}
  52. </select>
  53. </mapper>