DitchMapper.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. <select id="ditchList" resultType="com.ytpm.agent.view.AgentDitchView">
  27. select
  28. ditch_id, ditch_name, create_time
  29. from yt_ditch
  30. <where>
  31. user_id = #{userId}
  32. and is_delete=0
  33. </where>
  34. </select>
  35. <select id="ditchListForIos" resultType="com.ytpm.agent.view.AgentDitchView">
  36. select
  37. ditch_id, ditch_name, create_time
  38. from yt_ditch
  39. <where>
  40. is_delete = 0
  41. <if test="appId != null and appId != ''">
  42. and app_id = #{appId}
  43. </if>
  44. </where>
  45. </select>
  46. <select id="selectById" resultType="com.ytpm.agent.model.YtDitch">
  47. select
  48. ditch_id, ditch_name, user_id, is_delete, create_time
  49. from yt_ditch
  50. where ditch_id = #{ditchId}
  51. </select>
  52. </mapper>