From 23f8f5155749bbe0d2494c52d8adc3e6476b9cac Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期三, 20 十二月 2023 17:23:55 +0800 Subject: [PATCH] 2023-12-20 朱宝民 IC卡15个接口重构,角色授权,获取用户信息 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml | 87 +++++++++++++++++++++++++------------------ 1 files changed, 51 insertions(+), 36 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml index e4d1d89..329661f 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml @@ -5,7 +5,8 @@ <!--@mbg.generated--> <!--@Table se_unlock--> <id column="id" jdbcType="BIGINT" property="id" /> - <result column="cardId" jdbcType="BIGINT" property="cardid" /> + <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> + <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> <result column="money" jdbcType="FLOAT" property="money" /> <result column="remarks" jdbcType="VARCHAR" property="remarks" /> <result column="operator" jdbcType="BIGINT" property="operator" /> @@ -13,7 +14,7 @@ </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> - id, cardId, money, remarks, `operator`, operateDt + id, cardNum, clientNum, money, remarks, `operator`, operateDt </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <!--@mbg.generated--> @@ -27,19 +28,26 @@ delete from se_unlock where id = #{id,jdbcType=BIGINT} </delete> - <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true"> + + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock"> <!--@mbg.generated--> - insert into se_unlock (cardId, money, remarks, - `operator`, operateDt) - values (#{cardid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, - #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) + insert into se_unlock (id, cardNum, clientNum, money, + remarks, `operator`, operateDt + ) + values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT}, + #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP} + ) </insert> + <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true"> <!--@mbg.generated--> insert into se_unlock <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="cardid != null"> - cardId, + <if test="cardnum != null"> + cardNum, + </if> + <if test="clientnum != null"> + clientNum, </if> <if test="money != null"> money, @@ -55,8 +63,11 @@ </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="cardid != null"> - #{cardid,jdbcType=BIGINT}, + <if test="cardnum != null"> + #{cardnum,jdbcType=VARCHAR}, + </if> + <if test="clientnum != null"> + #{clientnum,jdbcType=VARCHAR}, </if> <if test="money != null"> #{money,jdbcType=FLOAT}, @@ -76,8 +87,11 @@ <!--@mbg.generated--> update se_unlock <set> - <if test="cardid != null"> - cardId = #{cardid,jdbcType=BIGINT}, + <if test="cardnum != null"> + cardNum = #{cardnum,jdbcType=VARCHAR}, + </if> + <if test="clientnum != null"> + clientNum = #{clientnum,jdbcType=VARCHAR}, </if> <if test="money != null"> money = #{money,jdbcType=FLOAT}, @@ -97,7 +111,8 @@ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock"> <!--@mbg.generated--> update se_unlock - set cardId = #{cardid,jdbcType=BIGINT}, + set cardNum = #{cardnum,jdbcType=VARCHAR}, + clientNum = #{clientnum,jdbcType=VARCHAR}, money = #{money,jdbcType=FLOAT}, remarks = #{remarks,jdbcType=VARCHAR}, `operator` = #{operator,jdbcType=BIGINT}, @@ -109,21 +124,21 @@ <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> SELECT COUNT(*) AS recordCount - FROM se_client_card card - INNER JOIN se_unlock unl ON unl.cardId = card.id - INNER JOIN ba_client cli ON card.clientId = cli.id - , (SELECT @i:=0) AS itable + FROM se_unlock unl + INNER JOIN se_client_card card ON unl.cardNum = card.cardNum + INNER JOIN ba_client cli ON unl.clientNum = cli.num + , (SELECT @i:=0) AS itable <where> <if test = "clientName != null and clientName !=''"> AND cli.name like CONCAT('%',#{clientName},'%') </if> - <if test = "cardAddr != null and cardAddr !=''"> - AND card.cardAddr like CONCAT('%',#{cardAddr},'%') + <if test = "cardNum != null and cardNum !=''"> + AND card.cardNum like CONCAT('%',#{cardNum},'%') </if> <if test = "unlocklTimeStart != null and unlockTimeStop != null"> - AND card.unlockDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} + AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} </if> </where> </select> @@ -131,31 +146,31 @@ <!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栬В閿佽褰�--> <select id="getUnlocks" resultType="com.dy.pipIrrGlobal.voSe.VoUnlock"> SELECT - (@i:=@i+1) AS id, - cli.`name` AS clientName, - cli.id AS clientId, - card.cardAddr, - unl.money, - (SELECT `name` FROM ba_user WHERE id = unl.operator) AS operator, - unl.operateDt - FROM se_client_card card - INNER JOIN se_unlock unl ON unl.cardId = card.id - INNER JOIN ba_client cli ON card.clientId = cli.id - , (SELECT @i:=0) AS itable + (@i:=@i+1) AS id, + cli.`name` AS clientName, + cli.num AS clientNum, + card.cardNum, + unl.money, + (SELECT `name` FROM ba_user WHERE id = unl.operator) AS operator, + unl.operateDt + FROM se_unlock unl + INNER JOIN se_client_card card ON unl.cardNum = card.cardNum + INNER JOIN ba_client cli ON unl.clientNum = cli.num + , (SELECT @i:=0) AS itable <where> <if test = "clientName != null and clientName !=''"> AND cli.name like CONCAT('%',#{clientName},'%') </if> - <if test = "cardAddr != null and cardAddr !=''"> - AND card.cardAddr like CONCAT('%',#{cardAddr},'%') + <if test = "cardNum != null and cardNum !=''"> + AND card.cardNum like CONCAT('%',#{cardNum},'%') </if> <if test = "unlocklTimeStart != null and unlockTimeStop != null"> - AND card.unlockDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} + AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} </if> </where> - + ORDER BY unl.operateDt DESC <if test="pageCurr != null and pageSize != null"> LIMIT ${pageCurr}, ${pageSize} </if> -- Gitblit v1.8.0