PtlAgreementAttributionMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.jzg.mapper.PtlAgreementAttributionMapper">
  4. <resultMap id="BaseResultMap" type="com.jzg.commons.entity.agreement.po.PtlAgreementAttribution">
  5. <result property="fields" column="fields" javaType="com.alibaba.fastjson.JSONArray"
  6. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  7. </resultMap>
  8. <select id="getAgreementAttributionList" resultType="com.jzg.commons.entity.agreement.po.PtlAgreementAttribution">
  9. select
  10. paa.id,
  11. paa.template_id,
  12. paa.api_type,
  13. paa.login_url,
  14. paa.api_type,
  15. paa.username,
  16. paa.password,
  17. paa.user_abbr,
  18. paa.user_dept,
  19. paa.user_desc,
  20. paa.use_status,
  21. paa.quote_status,
  22. eic.name_simple as insCompanyName,
  23. pau.url as url,
  24. sd.name as deptName
  25. from
  26. ptl_agreement_attribution paa
  27. left join ptl_agreement_url pau on paa.login_url = pau.id
  28. left join sys_dept sd on paa.user_dept = sd.id
  29. left join esm_ins_company eic on paa.ins_company_id = eic.id
  30. where
  31. 1=1
  32. and paa.is_delete = '0'
  33. <if test="ptlAgreementAttributionQueryVo.username != null and ptlAgreementAttributionQueryVo.username != ''">
  34. and paa.username like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  35. or paa.user_abbr like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  36. or eic.name_simple like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
  37. </if>
  38. <if test="ptlAgreementAttributionQueryVo.quoteStatus != null and ptlAgreementAttributionQueryVo.quoteStatus != ''">
  39. and paa.quote_status = #{ptlAgreementAttributionQueryVo.quoteStatus}
  40. </if>
  41. <if test="ptlAgreementAttributionQueryVo.insCompanyId != null and ptlAgreementAttributionQueryVo.insCompanyId != ''">
  42. and paa.ins_company_id = #{ptlAgreementAttributionQueryVo.insCompanyId}
  43. </if>
  44. <if test="ptlAgreementAttributionQueryVo.useStatus != null and ptlAgreementAttributionQueryVo.useStatus != ''">
  45. and paa.use_status = #{ptlAgreementAttributionQueryVo.useStatus}
  46. </if>
  47. <if test="ptlAgreementAttributionQueryVo.userDept != null and ptlAgreementAttributionQueryVo.userDept != ''">
  48. and paa.user_dept = #{ptlAgreementAttributionQueryVo.userDept}
  49. </if>
  50. order by paa.create_time desc
  51. </select>
  52. <select id="getAgreementAttribution" resultMap="BaseResultMap">
  53. select
  54. *,
  55. pau.url as url,
  56. sd.name as deptName
  57. from
  58. ptl_agreement_attribution paa
  59. left join ptl_agreement_url pau on paa.login_url = pau.id
  60. left join sys_dept sd on paa.user_dept = sd.id
  61. where
  62. 1=1
  63. and paa.is_delete = '0'
  64. <if test="id != null and id != ''">
  65. and paa.id = #{id}
  66. </if>
  67. </select>
  68. </mapper>