SysQRCodeRelationMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.ydtech.modules.admin.dao.SysQRCodeRelationMapper">
  4. <resultMap id="sysQRCodeRelationMap" type="com.ydtech.modules.admin.model.SysQRCodeRelation">
  5. <id column="id" jdbcType="INTEGER" property="id"/>
  6. <result column="api_type" jdbcType="INTEGER" property="apiType"/>
  7. <result column="ins_company_id" jdbcType="VARCHAR" property="insCompanyId"/>
  8. <result column="ins_company_name" jdbcType="VARCHAR" property="insCompanyName"/>
  9. <result column="qr_code_type" jdbcType="INTEGER" property="qrCodeType"/>
  10. <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  12. <result column="last_update_by" jdbcType="VARCHAR" property="lastUpdateBy"/>
  13. <result column="last_update_time" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. id, api_type, ins_company_id, ins_company_name, qr_code_type,create_by,create_time,last_update_by,last_update_time
  17. </sql>
  18. <insert id="insert" parameterType="com.ydtech.modules.admin.model.SysQRCodeRelation">
  19. insert into sys_qr_code_relation(api_type, ins_company_id, ins_company_name, qr_code_type,create_by,create_time,
  20. last_update_by,last_update_time)
  21. values (#{apiType},#{insCompanyId},#{insCompanyName},#{qrCodeType},#{createBy},current_timestamp,
  22. #{lastUpdateBy},current_timestamp)
  23. </insert>
  24. <update id="updateById" parameterType="com.ydtech.modules.admin.model.SysQRCodeRelation">
  25. update sys_qr_code_relation set api_type = #{et.apiType},ins_company_id = #{et.insCompanyId},
  26. ins_company_name = #{et.insCompanyName},qr_code_type = #{et.qrCodeType},
  27. last_update_by = #{et.lastUpdateBy}, last_update_time = current_timestamp
  28. where id = #{et.id}
  29. </update>
  30. <select id="selectByMap" resultMap="sysQRCodeRelationMap">
  31. select <include refid="Base_Column_List"/> from sys_qr_code_relation
  32. <where>
  33. <if test="cm.apiType != null ">
  34. and api_type = #{cm.apiType}
  35. </if>
  36. <if test="cm.insCompanyId != null ">
  37. and ins_company_id = #{cm.insCompanyId}
  38. </if>
  39. <if test="cm.insCompanyName != null ">
  40. and ins_company_name = #{cm.insCompanyName}
  41. </if>
  42. <if test="cm.qrCodeType != null ">
  43. and qr_code_type = #{cm.qrCodeType}
  44. </if>
  45. </where>
  46. </select>
  47. <delete id="deleteById">
  48. delete from sys_qr_code_relation where id = #{id}
  49. </delete>
  50. <select id="getQRCodeType" resultType="java.lang.Integer">
  51. select qr_code_type
  52. from sys_qr_code_relation
  53. where api_type = #{apiType} and ins_company_id = #{insCompanyId} and ins_company_name = #{insCompanyName}
  54. </select>
  55. </mapper>