123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.zhyc.xps.sys.mapper.PartnerMapper">
- <resultMap id="BaseResultMap" type="com.zhyc.xps.sys.entity.Partner">
- <id column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="partner_name" property="partnerName" jdbcType="VARCHAR" />
- <result column="partner_cat_id" property="partnerCatId" jdbcType="BIGINT" />
- <result column="partner_lxr" property="partnerLxr" jdbcType="VARCHAR" />
- <result column="partner_lxdh" property="partnerLxdh" jdbcType="VARCHAR" />
- <result column="partner_tyshxydm" property="partnerTyshxydm" jdbcType="VARCHAR" />
- <result column="partner_clrq" property="partnerClrq" jdbcType="DATE" />
- <result column="partner_dzyx" property="partnerDzyx" jdbcType="VARCHAR" />
- <result column="partner_area_code" property="partnerAreaCode" jdbcType="VARCHAR" />
- <result column="partner_area_name" property="partnerAreaName" jdbcType="VARCHAR" />
- <result column="partner_address" property="partnerAddress" jdbcType="VARCHAR" />
- <result column="partner_wzjd" property="partnerWzjd" jdbcType="DECIMAL"/><!--位置经度-->
- <result column="partner_wzwd" property="partnerWzwd" jdbcType="DECIMAL"/><!--位置纬度-->
- <result column="partner_desc" property="partnerDesc" jdbcType="VARCHAR" />
- </resultMap>
- <resultMap id="PartnerDtoMap" type="com.zhyc.xps.sys.dto.PartnerDto" extends="BaseResultMap">
- <result column="partner_cat_title" property="partnerCatTitle" jdbcType="VARCHAR"/>
- <result column="root_id" property="rootId" jdbcType="BIGINT"/>
- <result column="parent_id" property="parentId" jdbcType="BIGINT"/>
- <result column="admin_id" property="adminId" jdbcType="BIGINT"/>
- <result column="admin_name" property="adminName" jdbcType="VARCHAR"/>
- <result column="group_id" property="groupId" jdbcType="BIGINT"/>
- <result column="node_left" property="nodeLeft" jdbcType="BIGINT"/>
- <result column="node_right" property="nodeRight" jdbcType="BIGINT"/>
- <result column="node_level" property="nodeLevel" jdbcType="BIGINT"/>
- <result column="is_leaf" property="isLeaf" jdbcType="BIGINT"/>
- <result column="status" property="status" jdbcType="BIGINT"/>
- </resultMap>
- <sql id="PartnerDto_Cols" >
- A.oc_id,
- A.partner_name,
- A.partner_cat_id,
- D.partner_cat_title,
- A.partner_lxr,
- A.partner_lxdh,
- A.partner_dzyx,
- A.partner_tyshxydm,
- A.partner_clrq,
- A.partner_area_code,
- A.partner_area_name,
- A.partner_address,
- A.partner_wzjd,
- A.partner_wzwd,
- A.partner_desc,
- B.parent_id,
- B.root_id,
- B.admin_id,
- C.account_name AS admin_name,
- B.group_id,
- B.node_left,
- B.node_right,
- B.node_level,
- B.is_leaf,
- B.status
- </sql>
- <!-- 分页查询 -->
- <select id="getByPage" parameterType="java.util.Map" resultMap="PartnerDtoMap">
- SELECT
- <include refid="PartnerDto_Cols"/>
- FROM partner AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- LEFT JOIN account AS C ON (B.oc_id = C.oc_id AND B.admin_id = C.account_id)
- LEFT JOIN partner_cat AS D ON (A.partner_cat_id = D.partner_cat_id)
- WHERE A.deleted_flag=0
- <if test="ocId != null">
- AND A.oc_id = #{ocId}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.partner_name LIKE "%"#{keywords}"%"
- </if>
- ORDER BY A.oc_id DESC
- </select>
- <!-- 列表查询 -->
- <select id="getByList" parameterType="java.util.Map" resultMap="PartnerDtoMap">
- SELECT
- <include refid="PartnerDto_Cols"/>
- FROM partner AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- LEFT JOIN account AS C ON (B.oc_id = C.oc_id AND B.admin_id = C.account_id)
- LEFT JOIN partner_cat AS D ON (A.partner_cat_id = D.partner_cat_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.partner_name LIKE "%"#{keywords}"%"
- </if>
- ORDER BY A.oc_id DESC
- </select>
- <!--基于ID查询-->
- <select id="getById" resultMap="PartnerDtoMap" >
- SELECT
- <include refid="PartnerDto_Cols"/>
- FROM partner AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- LEFT JOIN account AS C ON (B.oc_id = C.oc_id AND B.admin_id = C.account_id)
- LEFT JOIN partner_cat AS D ON (A.partner_cat_id = D.partner_cat_id)
- WHERE 1=1 AND A.deleted_flag=0
- AND A.oc_id = #{ocId, jdbcType=BIGINT}
- </select>
- <!--新增Insert-->
- <insert id="create" useGeneratedKeys="true" keyProperty="ocId" parameterType="com.zhyc.xps.sys.entity.Partner">
- INSERT INTO partner
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="partnerName != null and partnerName != ''">
- partner_name,
- </if>
- <if test="partnerCatId != null">
- partner_cat_id,
- </if>
- <if test="partnerLxr != null and partnerLxr != ''">
- partner_lxr,
- </if>
- <if test="partnerLxdh != null and partnerLxdh != ''">
- partner_lxdh,
- </if>
- <if test="partnerDzyx != null and partnerDzyx != ''">
- partner_dzyx,
- </if>
- <if test="partnerTyshxydm != null and partnerTyshxydm != ''">
- partner_tyshxydm,
- </if>
- <if test="partnerClrq != null">
- partner_clrq,
- </if>
- <if test="partnerAreaCode != null and partnerAreaCode != ''">
- partner_area_code,
- </if>
- <if test="partnerAreaName != null and partnerAreaName != ''">
- partner_area_name,
- </if>
- <if test="partnerAddress != null and partnerAddress != '' ">
- partner_address,
- </if>
- <if test="partnerWzjd != null">
- partner_wzjd,
- </if>
- <if test="partnerWzwd != null">
- partner_wzwd,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId, jdbcType=BIGINT},
- </if>
- <if test="partnerName != null and partnerName != ''">
- #{partnerName,jdbcType=VARCHAR},
- </if>
- <if test="partnerCatId != null">
- #{partnerCatId,jdbcType=BIGINT},
- </if>
- <if test="partnerLxr != null and partnerLxr != ''">
- #{partnerLxr , jdbcType=VARCHAR},
- </if>
- <if test="partnerLxdh != null and partnerLxdh != ''">
- #{partnerLxdh , jdbcType=VARCHAR},
- </if>
- <if test="partnerDzyx != null and partnerDzyx != ''">
- #{partnerDzyx , jdbcType=VARCHAR},
- </if>
- <if test="partnerTyshxydm != null and partnerTyshxydm != ''">
- #{partnerTyshxydm , jdbcType=VARCHAR},
- </if>
- <if test="partnerClrq != null">
- #{partnerClrq , jdbcType=DATE},
- </if>
- <if test="partnerAreaCode != null and partnerAreaCode != ''">
- #{partnerAreaCode , jdbcType=VARCHAR},
- </if>
- <if test="partnerAreaName != null and partnerAreaName != ''">
- #{partnerAreaName , jdbcType=VARCHAR},
- </if>
- <if test="partnerAddress != null and partnerAddress != ''">
- #{partnerAddress , jdbcType=VARCHAR},
- </if>
- <if test="partnerWzjd != null">
- #{partnerWzjd, jdbcType=DECIMAL},
- </if>
- <if test="partnerWzwd != null">
- #{partnerWzwd, jdbcType=DECIMAL},
- </if>
- <if test="createdBy != null">
- #{createdBy , jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt, jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--Update更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.Partner">
- UPDATE partner
- <trim suffixOverrides=",">
- <set>
- <if test="partnerName != null and partnerName != ''">
- partner_name = #{partnerName,jdbcType=VARCHAR},
- </if>
- <if test="partnerCatId != null">
- partner_cat_id = #{partnerCatId,jdbcType=BIGINT},
- </if>
- <if test="partnerLxr != null">
- partner_lxr = #{partnerLxr,jdbcType=VARCHAR},
- </if>
- <if test="partnerLxdh != null">
- partner_lxdh = #{partnerLxdh,jdbcType=VARCHAR},
- </if>
- <if test="partnerDzyx != null">
- partner_dzyx = #{partnerDzyx , jdbcType=VARCHAR},
- </if>
- <if test="partnerTyshxydm != null">
- partner_tyshxydm = #{partnerTyshxydm , jdbcType=VARCHAR},
- </if>
- <if test="partnerClrq != null">
- partner_clrq = #{partnerClrq , jdbcType=DATE},
- </if>
- <if test="partnerAreaCode != null">
- partner_area_code = #{partnerAreaCode , jdbcType=VARCHAR},
- </if>
- <if test="partnerAreaName != null">
- partner_area_name = #{partnerAreaName , jdbcType=VARCHAR},
- </if>
- <if test="partnerAddress != null">
- partner_address = #{partnerAddress , jdbcType=VARCHAR},
- </if>
- <if test="partnerWzjd != null">
- partner_wzjd = #{partnerWzjd, jdbcType=DECIMAL},
- </if>
- <if test="partnerWzwd != null">
- partner_wzwd = #{partnerWzwd, jdbcType=DECIMAL},
- </if>
- <if test="partnerDesc != null">
- partner_desc = #{partnerDesc, jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null">
- updated_by = #{updatedBy,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId, jdbcType=BIGINT}
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE partner
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedAt != null">
- deleted_at = #{deletedAt ,jdbcType=DATE},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 =1
- AND oc_id = #{ocId ,jdbcType = BIGINT}
- </update>
- </mapper>
|