MmInfoCertificateMapper.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.ygj.yuemum.dao.maternitymatron.MmInfoCertificateDao" >
  4. <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.maternitymatron.MmInfoCertificate" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="servant_code" property="servant_code" jdbcType="INTEGER" />
  7. <result column="certificate_code" property="certificate_code" jdbcType="INTEGER" />
  8. <result column="start_date" property="start_date" jdbcType="DATE" />
  9. <result column="end_date" property="end_date" jdbcType="DATE" />
  10. </resultMap>
  11. <sql id="Base_Column_List" >
  12. id, servant_code, certificate_code,start_date,end_date
  13. </sql>
  14. <!-- 得到月嫂证书信息 -->
  15. <select id="getAll" resultMap="BaseResultMap" >
  16. select
  17. <include refid="Base_Column_List" />
  18. from mm_info_certificate
  19. </select>
  20. <!-- 根据id查找月嫂证书信息 -->
  21. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  22. select
  23. <include refid="Base_Column_List" />
  24. from mm_info_certificate
  25. where servant_code = #{servant_code,jdbcType=INTEGER}
  26. </select>
  27. <!-- 根据id删除月嫂证书信息 -->
  28. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  29. delete from mm_info_certificate
  30. where id = #{id,jdbcType=INTEGER}
  31. </delete>
  32. <!-- 插入一条月嫂证书信息 -->
  33. <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.maternitymatron.MmInfoCertificate" >
  34. insert into mm_info_certificate
  35. <trim prefix="(" suffix=")" suffixOverrides="," >
  36. <if test="servant_code != null" >
  37. servant_code,
  38. </if>
  39. <if test="certificate_code != null" >
  40. certificate_code,
  41. </if>
  42. <if test="start_date != null" >
  43. start_date,
  44. </if>
  45. <if test="end_date != null" >
  46. end_date,
  47. </if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides="," >
  50. <if test="servant_code != null" >
  51. #{servant_code,jdbcType=INTEGER},
  52. </if>
  53. <if test="certificate_code != null" >
  54. #{certificate_code,jdbcType=INTEGER},
  55. </if>
  56. <if test="start_date != null" >
  57. #{start_date,jdbcType=DATE},
  58. </if>
  59. <if test="end_date != null" >
  60. #{end_date,jdbcType=DATE},
  61. </if>
  62. </trim>
  63. </insert>
  64. <!-- 根据id更新一条月嫂证书信息 -->
  65. <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.maternitymatron.MmInfoCertificate" >
  66. update mm_info_certificate
  67. <set >
  68. <if test="servant_code != null" >
  69. servant_code = #{servant_code,jdbcType=VARCHAR},
  70. </if>
  71. <if test="certificate_code != null" >
  72. certificate_code = #{certificate_code,jdbcType=VARCHAR},
  73. </if>
  74. <if test="start_date != null" >
  75. start_date = #{start_date,jdbcType=INTEGER},
  76. </if>
  77. <if test="end_date != null" >
  78. end_date = #{end_date,jdbcType=VARCHAR},
  79. </if>
  80. </set>
  81. where id = #{id,jdbcType=INTEGER}
  82. </update>
  83. </mapper>