TransportationInfo.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.TransportationInfoDAO">
  6. <resultMap id="TransportationInfoMap" type="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="phone" column="phone_" />
  10. <result property="contact" column="contact_" />
  11. <result property="introduction" column="introduction_" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="delFlag" column="del_flag" />
  17. </resultMap>
  18. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  19. <!--
  20. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  21. select sys_guid() from dual
  22. </selectKey>
  23. -->
  24. <![CDATA[
  25. insert into base_transportation_info
  26. (id_,name_,phone_,contact_,introduction_,create_time,update_time,create_by,update_by,del_flag)
  27. values
  28. (
  29. #{id,jdbcType=VARCHAR}
  30. ,#{name,jdbcType=VARCHAR}
  31. ,#{phone,jdbcType=VARCHAR}
  32. ,#{contact,jdbcType=VARCHAR}
  33. ,#{introduction,jdbcType=VARCHAR}
  34. ,#{createTime,jdbcType= TIMESTAMP }
  35. ,#{updateTime,jdbcType= TIMESTAMP }
  36. ,#{createBy,jdbcType=VARCHAR}
  37. ,#{updateBy,jdbcType=VARCHAR}
  38. ,#{delFlag,jdbcType= NUMERIC }
  39. )
  40. ]]>
  41. </insert>
  42. <delete id="delete" parameterType="string">
  43. delete from base_transportation_info where id_=#{id,jdbcType=VARCHAR}
  44. </delete>
  45. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.TransportationInfo">
  46. update base_transportation_info
  47. <set>
  48. <if test="name!=null">
  49. name_=#{name,jdbcType=VARCHAR},
  50. </if>
  51. <if test="phone!=null">
  52. phone_=#{phone,jdbcType=VARCHAR},
  53. </if>
  54. <if test="contact!=null">
  55. contact_=#{contact,jdbcType=VARCHAR},
  56. </if>
  57. <if test="introduction!=null">
  58. introduction_=#{introduction,jdbcType=VARCHAR},
  59. </if>
  60. <if test="createTime!=null">
  61. create_time=#{createTime,jdbcType= TIMESTAMP },
  62. </if>
  63. <if test="updateTime!=null">
  64. update_time=#{updateTime,jdbcType= TIMESTAMP },
  65. </if>
  66. <if test="createBy!=null">
  67. create_by=#{createBy,jdbcType=VARCHAR},
  68. </if>
  69. <if test="updateBy!=null">
  70. update_by=#{updateBy,jdbcType=VARCHAR},
  71. </if>
  72. <if test="delFlag!=null">
  73. del_flag=#{delFlag,jdbcType= NUMERIC },
  74. </if>
  75. </set>
  76. where id_=#{id}
  77. </update>
  78. <select id="get" parameterType="string" resultMap="TransportationInfoMap">
  79. select * from base_transportation_info where id_=#{0}
  80. </select>
  81. <select id="exist" parameterType="string" resultType="int">
  82. select count(*) from base_transportation_info where id_=#{0}
  83. </select>
  84. <select id="list" resultMap="TransportationInfoMap">
  85. select * from base_transportation_info where del_flag=false order by create_time desc
  86. </select>
  87. <select id="listByIndex" resultMap="TransportationInfoMap">
  88. select * from base_transportation_info where del_flag=false order by create_time desc limit #{0}
  89. </select>
  90. <select id="findByCustomerId" resultMap="TransportationInfoMap">
  91. select * from base_transportation_info where del_flag=false and customer_id=#{0}
  92. </select>
  93. <select id="search" parameterType="hashmap" resultMap="TransportationInfoMap">
  94. <![CDATA[
  95. select * from base_transportation_info
  96. ]]>
  97. <where>
  98. <if test="searchParams.id != null">
  99. and ID_ like #{searchParams.id}
  100. </if>
  101. </where>
  102. <foreach item="sort" collection="sortList" open="order by" separator=",">
  103. ${sort.name} ${sort.order}
  104. </foreach>
  105. </select>
  106. <select id="searchMobile" parameterType="hashmap" resultMap="TransportationInfoMap">
  107. <![CDATA[
  108. select * from base_transportation_info
  109. ]]>
  110. <where>
  111. del_flag=false
  112. <if test="searchParams.name != null">
  113. and name_ like #{searchParams.name}
  114. </if>
  115. </where>
  116. <foreach item="sort" collection="sortList" open="order by" separator=",">
  117. ${sort.name} ${sort.order}
  118. </foreach>
  119. </select>
  120. </mapper>