WzStrategyDao.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.example.dao.gdc.WzStrategyDao">
  4. <resultMap type="com.example.pojo.gdc.WzHouseContracEntity" id="wxUserMap">
  5. <result property="id" column="id"/>
  6. <result property="city" column="city"/>
  7. <result property="county" column="county"/>
  8. </resultMap>
  9. <update id="update">
  10. update house_theme.wz_f_strategy
  11. <set>
  12. <if test="type!= null"> type =#{type},</if>
  13. </set>
  14. <set>
  15. <if test="value!= null"> value =#{value},</if>
  16. </set>
  17. where id = #{id}
  18. </update>
  19. <delete id="delById">
  20. delete
  21. from house_theme.wz_f_strategy
  22. where id = #{id}
  23. </delete>
  24. <select id="queryList" resultType="com.example.pojo.gdc.WzStrategyEntity">
  25. select
  26. id,
  27. creator,
  28. create_time as createTime,
  29. type,
  30. value
  31. from house_theme.wz_f_strategy
  32. WHERE 1=1
  33. <if test="name != null and name.trim() != ''">
  34. AND name LIKE concat('%',#{name},'%')
  35. </if>
  36. <if test="city != null and city.trim() != ''">
  37. AND city LIKE concat('%',#{city},'%')
  38. </if>
  39. <if test="county != null and county.trim() != ''">
  40. AND county LIKE concat('%',#{county},'%')
  41. </if>
  42. <if test="phone != null and phone.trim() != ''">
  43. AND phone LIKE concat('%',#{phone},'%')
  44. </if>
  45. order by id
  46. </select>
  47. <select id="queryTotal" resultType="int">
  48. select count(*) from house_theme.wz_f_strategy
  49. WHERE 1=1
  50. <if test="name != null and name.trim() != ''">
  51. AND name LIKE concat('%',#{name},'%')
  52. </if>
  53. <if test="city != null and city.trim() != ''">
  54. AND city LIKE concat('%',#{city},'%')
  55. </if>
  56. <if test="county != null and county.trim() != ''">
  57. AND county LIKE concat('%',#{county},'%')
  58. </if>
  59. <if test="phone != null and phone.trim() != ''">
  60. AND phone LIKE concat('%',#{phone},'%')
  61. </if>
  62. <if test="statisticalMonth != null ">
  63. AND statistical_month = #{statisticalMonth}
  64. </if>
  65. </select>
  66. <select id="getObject" resultType="com.example.pojo.gdc.WzStrategyEntity">
  67. select
  68. id,
  69. creator,
  70. create_time as createTime,
  71. type,
  72. value
  73. from house_theme.wz_f_strategy
  74. where id = #{id}
  75. </select>
  76. <select id="getObjectByType" resultType="com.example.pojo.gdc.WzStrategyEntity">
  77. select
  78. id,
  79. creator,
  80. create_time as createTime,
  81. type,
  82. value
  83. from house_theme.wz_f_strategy
  84. where type = 1
  85. </select>
  86. <insert id="save" parameterType="com.example.pojo.gdc.WzStrategyEntity" >
  87. insert into house_theme.wz_f_strategy(
  88. creator,
  89. create_time,
  90. type,
  91. value
  92. ) values(
  93. #{creator},
  94. #{createTime},
  95. #{type},
  96. #{value}
  97. )
  98. </insert>
  99. </mapper>